CalculationTime

Coordinate geometry

Slope Calculator

Give it two points and it tells you, in plain words, how steep the line is - then shows you the graph, the angle, the grade and the equation. Drag the dots and watch the slope change.

Calculator

Slope between two points

Type two points or drag the dots on the graph. Everything updates as you go.

Rise 12 over a run of 6 - the classic two-points-to-slope example.

Point 1
Point 2
Rising line (positive slope)
Slope (m)2

For every 1 unit you move right, the line goes up 2 units.

Show the working
  1. rise = y₂ − y₁ = 15 − 3 = 12
  2. run = x₂ − x₁ = 8 − 2 = 6
  3. slope m = rise ÷ run = 12 ÷ 6 = 2
  4. y-intercept b = y₁ − m·x₁ = 3 − 2·2 = −1
  5. equation of the line: y = 2x − 1
−50510051015run = 6rise = 1263.4°P₁ (2, 3)P₂ (8, 15)

Both axes use the same scale, so the angle you see is the real angle. Drag either dot to reshape the line.

As a fraction
2/1
Angle from flat
63.43°
Percent grade
200%
Steepness
steeper than 45° - rise is bigger than run
Line equation
y = 2x − 1
Distance P₁ to P₂
13.4164
Midpoint
(5, 9)
Perpendicular slope
−0.5

For developers

Use it in code

These snippets already contain your two points. They use only the standard library and print the same numbers as this page.

import math

x1, y1 = 2, 3
x2, y2 = 8, 15

rise = y2 - y1
run = x2 - x1

print(f"distance={math.hypot(run, rise)}")
print(f"midpoint={(x1 + x2) / 2},{(y1 + y2) / 2}")

if run == 0 and rise == 0:
    print("slope=undefined (the two points are the same)")
elif run == 0:
    print("slope=undefined (vertical line)")
    print("angle_deg=90")
else:
    slope = rise / run
    print(f"slope={slope}")
    print(f"angle_deg={math.degrees(math.atan(slope))}")
    print(f"grade_percent={slope * 100}")
    print(f"y_intercept={y1 - slope * x1}")

The code prints full floating-point precision (for example 0.44999999999999996 where the page shows 0.45), so round for display.

Print room

Printable slope worksheet

Your current line, the graph, the full working, plus blank practice problems and a coordinate grid. Set the points above, then print or save as PDF.

CalculationTime worksheet

Finding slope from two points

Name: ______________________Date: ______________________

Worked example: your line

P₁ = (2, 3)    P₂ = (8, 15)

  1. rise = y₂ − y₁ = 15 − 3 = 12
  2. run = x₂ − x₁ = 8 − 2 = 6
  3. slope m = rise ÷ run = 12 ÷ 6 = 2
  4. y-intercept b = y₁ − m·x₁ = 3 − 2·2 = −1
  5. equation of the line: y = 2x − 1

Answer: m = 2

For every 1 unit you move right, the line goes up 2 units.

Remember

  • slope = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁)
  • Keep the subtraction in the same order on top and bottom.
  • Positive slope rises to the right; negative falls.
  • Flat line: slope 0. Vertical line: slope undefined.
−50510051015run = 6rise = 1263.4°P₁ (2, 3)P₂ (8, 15)

Your turn

1. P₁ (____ , ____)   P₂ (____ , ____)rise = ______   run = ______   slope = ______
2. P₁ (____ , ____)   P₂ (____ , ____)rise = ______   run = ______   slope = ______
3. P₁ (____ , ____)   P₂ (____ , ____)rise = ______   run = ______   slope = ______
4. P₁ (____ , ____)   P₂ (____ , ____)rise = ______   run = ______   slope = ______
-55-44-33-22-1101-12-23-34-45-5
calculationtime.com/calculators/slope-calculator/ · Free to print for classroom and personal use.

Embeddable calculator

Embed this calculator

Copy a clean iframe version with the required CalculationTime attribution link built in.

In depth

Slope, angle and grade are three names for one steepness

Slope is rise ÷ run. Ask a builder, a driver and a mathematician how steep something is and you get three different-looking answers: a pitch such as 6/12, a road-sign grade such as 6%, or an angle such as 26.6°. They are all the same measurement. Grade is slope × 100, and the angle is the inverse tangent of the slope.

Everyday steepness, converted
ExampleRise : runSlopeAngleGrade
Accessible ramp, steepest commonThe 1:12 limit in the US ADA design standards for ramps1 : 120.08334.76°8.33%
Gentle drainage fallExample only - drainage rules vary by material and code1 : 800.01250.72°1.25%
Roof pitch 4/12Low-slope shingled roof4 : 120.333318.43°33.33%
Typical stairIllustrative 7 in riser with an 11 in tread7 : 110.636432.47°63.64%
Roof pitch 6/12A very common residential pitch6 : 120.526.57°50%
Roof pitch 12/12Rise equals run - exactly 45°12 : 12145°100%

angle = arctan(slope)

Slope 1 is 45°. Slope grows without limit as the angle approaches 90°, which is why a vertical line has no slope at all.

grade = slope × 100

A 100% grade is not a cliff - it is a 45° line. Grade keeps counting past 100% for anything steeper.

ratio = 1 : (1 ÷ slope)

A slope of 0.0833 is a 1 : 12 ratio. Ramp and drainage rules are usually written this way.

The four cases

Positive, negative, zero and undefined

Every straight line falls into one of four cases. Two of them cause most of the mistakes: a flat line has slope 0, while a vertical line has no slope at all. Zero is a number; undefined is the absence of one.

Positive

Rises as you move right.

Negative

Falls as you move right.

Zero

Perfectly flat.

Undefined

Perfectly vertical.

From slope to the whole line

Once you have the slope, you have the line

Slope is one half of a line’s identity; the other half is where it sits. Slide the line up or down and the slope stays the same – only the y-intercept b changes. That is why the calculator finds m first and then b.

Slope-intercept form

y = mx + b. Read the slope straight off the number in front of x, and the intercept where the line crosses the y-axis.

Parallel lines

Same slope, different intercepts. They run side by side forever and never meet.

Perpendicular lines

Slopes multiply to −1. The perpendicular of slope 2 is −1/2, and the perpendicular of slope 0.25 is −4.

Check your work

Four slope mistakes worth knowing

Reversing only one subtraction

(y₂ − y₁) ÷ (x₁ − x₂) flips the sign. Subtract both in the same order; the working panel shows each step so you can compare.

Run over rise

Slope is rise on top. Flip it and 12/6 becomes 6/12 - a completely different line. Slope 2 rises fast; slope 0.5 rises slowly.

Different units

6 inches of rise over 2 feet of run is not slope 3. Convert both to the same unit first: 6 in over 24 in is 0.25.

Trusting a stretched graph

If a graph’s axes use different scales the line looks steeper or flatter than it is. This calculator’s graph keeps both axes equal so the angle you see is honest.

Questions people ask

Slope Calculator: frequently asked questions

How do you calculate slope from two points?

Subtract the first y-value from the second y-value to get rise, subtract the first x-value from the second x-value to get run, then divide rise by run.

What does an undefined slope mean?

An undefined slope means the run is zero because the two x-values are the same. The line is vertical, so the formula would require division by zero.

Is a horizontal line slope zero?

Yes. If the y-values are the same and the x-values are different, the rise is zero and the slope is 0.

Can slope be negative?

Yes. A negative slope means the line falls as x increases, or rises as x decreases, depending on the direction you read the line.

What should the printable slope report include?

A useful slope worksheet should show both points, rise, run, final slope, formula, date and notes so homework, drawings or site sketches can be checked later.

How do I turn slope into an angle?

Take the inverse tangent of the slope: angle = arctan(rise ÷ run). A slope of 1 is 45°, a slope of 0.5 is about 26.6°, and a slope of 2 is about 63.4°. The calculator shows the angle for your line automatically.

How do I turn slope into a percent grade?

Multiply the slope by 100. A slope of 0.06 is a 6% grade. Note that grade can be far above 100%: a 45° line is a 100% grade and steeper lines keep climbing.

How do I find the equation of the line from two points?

Work out the slope m first, then the y-intercept b = y₁ − m·x₁. The line is y = mx + b. The calculator shows every step, and handles the special cases: a vertical line is x = a number, and a horizontal line is y = a number.

How do I know if two lines are parallel or perpendicular?

Parallel lines have exactly the same slope. Perpendicular lines have slopes that multiply to −1, so the perpendicular slope is the negative reciprocal (−1 ÷ m). The calculator shows the perpendicular slope for your line.

Certification notes

Source, method and limitation basis

Slope is a compact way to describe steepness and direction. In school algebra it connects coordinate points to line equations; in practical work the same rise-over-run idea appears in ramps, roofs, drainage falls, graph reading and measurement sketches. Reviewed 2026-09-21.

Model limits

This is the slope of the straight line through exactly two points. It is not a best-fit line through many measurements (use a regression tool for that), and it is not a substitute for a surveyor, engineer or building code when a real ramp, roof or drain is being designed.

Assumptions

  • Coordinates use the same linear units on both axes unless your graph or drawing states a different scale.
  • The result is the slope of the straight line through the two points, not a curve fit through many points.
  • If x₂ equals x₁, the line is vertical and the slope is undefined rather than zero.
  • If y₂ equals y₁ and the run is not zero, the line is horizontal and the slope is zero.
  • Rounding is only for display; keep the exact rise and run when copying to homework, CAD notes or engineering checks.

Cite this page

Use the canonical URL, the page title “Slope Calculator - CalculationTime”, and the review date 2026-09-21.