Slope Calculator

Slope Calculator

Gradient from two points, rise and run, or an angle, with every form and the working.

Slope (gradient) m
0

Grade is rise ÷ run × 100. The 1 in n ratio means 1 unit up for every n units across. A vertical line has an undefined slope.

This slope calculator finds the gradient of a line for students, builders, cyclists and anyone reading a graph, starting from two points, a rise and run, or a known angle or grade. Alongside the slope it gives the fraction, the angle, the percentage grade, the 1 in n ratio and the equation y = mx + c, and it follows the same standard definition of slope used in UK and US maths courses, with each step written out.

Quick answer: slope equals rise over run: m = (y₂ minus y₁) ÷ (x₂ minus x₁). For the points (1, 2) and (9, 8), the rise is 6 and the run is 8, so the slope calculator gives m = 0.75, or 3/4: a 75% grade, an angle of 36.87 degrees and the line y = 0.75x + 1.25.

Slope calculator showing gradient, angle, percentage grade and line equation for two points
How the Slope Calculator works: two points in, slope, angle, grade and equation out.

What Is Slope?

Slope is the steepness of a line: the change in height for every one unit you move horizontally. UK schools usually call it the gradient and write straight lines as y = mx + c, while US textbooks write y = mx + b, but m means the same thing in both.

The formula in plain words: subtract the first y value from the second to get the rise, subtract the first x value from the second to get the run, then divide the rise by the run. Order matters only in that you must subtract in the same direction on top and bottom. A positive slope climbs from left to right, a negative slope falls, a slope of 0 is flat, and a vertical line has no slope at all because its run is 0.

How to Use the Slope Calculator

Step 1: Choose Your Starting Point

The slope calculator has three starting points. Pick Two points for graph and coordinate questions, Rise and run for physical measurements such as a ramp or a drive, or Angle or grade to convert a road sign percentage, a 1 in n ratio or an angle into the other forms.

Step 1: choose two points, rise and run, or angle and grade

Step 2: Enter the Coordinates

Type x₁, y₁ for the first point and x₂, y₂ for the second. Negative numbers and decimals are fine. The result updates as you type, and the fraction form keeps exact values such as 2/3 that a decimal would round.

Step 2: enter the coordinates of the two points

Step 3: Read the Gradient in Every Form

Under the main figure, the slope calculator gives the angle with the x axis, the percentage grade, the 1 in n ratio, the straight line distance between the points, the rise and run, and the perpendicular slope.

Step 3: read the slope as an angle, grade, ratio and distance

Step 4: Copy the Equation and Check the Working

The box gives the line in slope intercept form and point slope form, followed by the working: rise, run, division, intercept and angle. Showing these lines in an exam answer earns method marks even if you slip on the arithmetic.

Step 4: copy the line equation and check the working

How Do You Find the Slope Between Two Points?

Divide the difference in y values by the difference in x values: m = (y₂ minus y₁) ÷ (x₂ minus x₁). Then find the intercept with c = y₁ minus m × x₁ to write the full equation.

Worked example: Owen is planning a garden ramp for his dad's wheelchair. The back door step is 0.3 metres high and he has 4.2 metres of flat path to reach it. Treat the path as points (0, 0) and (4.2, 0.3), or use Rise and run directly. The slope is 0.3 ÷ 4.2 = 0.0714, which is a grade of 7.14%, an angle of 4.09 degrees and a ratio of 1 in 14. The ramp surface itself is √(0.3² + 4.2²) = 4.21 metres long, which tells him how much decking to order.

Building regulations in England limit how steep and how long an access ramp may be, so Owen compares his 1 in 14 with the Approved Document M guidance on GOV.UK before he orders anything, and plans a level landing at the top. Running the slope calculator again with a longer path shows how much gentler each extra metre makes the climb.

What Is the Difference Between Slope, Grade and Angle?

They describe the same steepness in three ways: slope is rise ÷ run as a number, grade is that number × 100 as a percentage, and the angle is arctan of the slope in degrees. A 100% grade is a 45 degree angle, not a vertical wall. UK road signs used 1 in n ratios until the 1970s and now show percentages, so a sign reading 25% is the old 1 in 4.

RatioSlope mGradeAngle
1 in 200.055%2.86°
1 in 120.08338.33%4.76°
1 in 100.110%5.71°
1 in 40.2525%14.04°
1 in 11100%45°

Notice that grade and angle are not proportional: doubling the grade from 10% to 20% does not double the angle exactly, because the angle comes from the arctan function. The trigonometry calculator shows the tan and arctan steps behind these conversions if you want to see them in detail.

What Does a Negative, Zero or Undefined Slope Mean?

A negative slope means the line falls as x increases, a zero slope means it is perfectly horizontal, and an undefined slope means it is vertical. For example, from (2, 7) to (6, 3) the slope is minus 4 ÷ 4 = minus 1, a line falling at 45 degrees. From (3, 1) to (3, 9) the run is 0, so the slope is undefined and the equation is simply x = 3.

How Are Parallel and Perpendicular Slopes Related?

Parallel lines have equal slopes, and perpendicular lines have slopes that multiply to minus 1, so each is the negative reciprocal of the other. A line with slope 3/4 is perpendicular to any line with slope minus 4/3, because 3/4 × minus 4/3 = minus 1. The slope calculator lists the perpendicular slope for every pair of points, so you can write the equation of a normal line straight away.

  • Keep the same order on top and bottom: (y₂ minus y₁) with (x₂ minus x₁), never mixed.
  • Use the same unit for rise and run, such as metres for both.
  • Measure run horizontally, not along the sloping surface.
  • A 1 in n ratio is steeper when n is smaller: 1 in 4 is much steeper than 1 in 20.

To turn a fractional slope such as 7/12 into a decimal, the fraction to decimal converter does it in one step, while the ratio calculator simplifies rise to run ratios such as 30:420 down to 1:14. Formulas checked October 2026.

Slope Calculator Terms You Should Know

These definitions explain the coordinates, forms and measures behind the slope calculator so you can move confidently between gradients, angles, grades and line equations.

Gradient (m)
The ratio of vertical change to horizontal change along a straight line, which stays constant at every point on that line. A larger absolute value means a steeper line, and the sign shows whether it rises or falls from left to right.
Cartesian coordinates
A system that locates each point on a plane with an ordered pair, the horizontal x value and the vertical y value, measured from a fixed origin. Two such pairs are enough to define exactly one straight line.
Slope-intercept form
The equation of a line written as y = mx + c in the UK, where c is the y-intercept, the height at which the line crosses the vertical axis. Substituting one known point reveals c once the gradient is known.
Percentage grade
Steepness expressed as a percentage, found by multiplying rise over run by 100. Road signs use it, so a 10% grade climbs 10 metres for every 100 metres travelled horizontally, which is far gentler than a 10 degree angle.
Inverse tangent
The trigonometric function, often written arctan, that converts a ratio back into an angle. Applying it to the slope gives the angle between the line and the horizontal x axis, measured in degrees or radians.
Perpendicular slope
The gradient of any line meeting a given line at a right angle. It equals the negative reciprocal of the original slope, so the two gradients multiply to give minus one, except when one of the lines is vertical.
</>Embed this calculator on your website

Add the free Slope Calculator to your own site or blog. Copy the code below and paste it into an HTML block. It resizes itself and works on phones.

How we checked this tool: the Tools Veria Editorial Team built this tool by hand, checked it against the official rules or published standards where they apply, and tested it against worked examples. Results are estimates for planning, not personal financial or tax advice. Read our editorial policy and disclaimer, or report an error.

Frequently Asked Questions

What is the formula for slope?

Slope m = (y₂ minus y₁) ÷ (x₂ minus x₁), which is rise divided by run. For the points (1, 2) and (9, 8) that is 6 ÷ 8 = 0.75, so y rises 0.75 units for every 1 unit across.

How do I convert a slope to a percentage?

Multiply the slope by 100. A slope of 0.0714 is a 7.14% grade, and a slope of 0.25 is a 25% grade, which older UK road signs showed as 1 in 4.

How do I convert a slope to an angle?

Take the arctan of the slope. A slope of 0.75 gives arctan(0.75) = 36.87 degrees, and a slope of 1 gives exactly 45 degrees. The slope calculator does this for you.

Is gradient the same as slope?

Yes. Gradient is the usual term in UK schools and slope is more common in the US, but both mean rise divided by run, written m in the equation y = mx + c or y = mx + b.

What is the slope of a vertical line?

A vertical line has an undefined slope because its run is 0 and you cannot divide by zero. Its equation is written as x = a number, for example x = 3.

What does a 1 in 12 slope mean?

It means the surface rises 1 unit for every 12 units of horizontal distance. That is a slope of 0.0833, a grade of 8.33% and an angle of about 4.76 degrees.