Slope Calculator from two points

The slope between (1, 2) and (5, 10) is 2: rise ÷ run = (10 − 2) ÷ (5 − 1) = 8 ÷ 4. The line’s equation is y = 2x, and it rises at 63.435° to the horizontal.

Your result

Slope m

2

Slope-intercept
y = 2x
Point-slope
y − 2 = 2(x − 1)
Angle with x-axis
63.435°
Grade
200%
Distance between points
8.944272
Midpoint
(3, 6)
x-intercept
0

Step-by-step working

  1. Rise: y₂ − y₁ = 10 − 2 = 8
  2. Run: x₂ − x₁ = 5 − 1 = 4
  3. m = rise ÷ run = 8 ÷ 4 = 2
  4. b = y₁ − m·x₁ = 2 − 2 × 1 = 0
The line through both pointsy-5051015-101234567x

Understand it

What the Slope Calculator Does

Slope measures how steep a line is: how much y changes for each one-unit change in x. Positive slopes rise left to right, negative slopes fall, zero is flat, and vertical lines have undefined slope.

Enter two points, one point and the slope, or a rise and run to get the slope, the equation in slope-intercept and point-slope form, the angle in degrees, the percent grade used for roads and ramps, plus distance and midpoint — with a graph of the line.

How the Slope Formula Works

m = (y₂ − y₁) / (x₂ − x₁) y = mx + b, b = y₁ − m·x₁ Angle θ = arctan(m) Distance = √((x₂ − x₁)² + (y₂ − y₁)²)
m
slope (rise over run)
b
y-intercept

Worked Examples

Falling line

What do you know?: Two points · x₁: -2 · y₁: 4 · x₂: 3 · y₂: -1

Slope m-1

m = -1; y = -1x + 2.

Wheelchair ramp: 1 ft rise over 12 ft

What do you know?: Two points · x₁: 0 · y₁: 0 · x₂: 12 · y₂: 1

Slope m0.083333

Grade 8.33%, angle 4.764° — the ADA maximum.

Horizontal line

What do you know?: Two points · x₁: 0 · y₁: 3 · x₂: 7 · y₂: 3

Slope m0

Slope 0: y never changes.

Original analysis

Slope Analysis in numbers

Every chart below is generated from the same tested formula that powers the calculator above, so you can see the patterns behind a single result.

Angle in degrees for each percent gradeAngle (°)010203040501%5%8.33%10%15%25%50%100%Grade0.572.864.765.718.53142745
View data table
GradeSlopeAngleExample
1%0.010.57°Drainage
5%0.052.86°Accessible path
8.33%0.08334.76°ADA ramp max (1:12)
10%0.15.71°Steep road
15%0.158.53°Very steep street
25%0.2514.04°Stairs-like
50%0.526.57°Ski slope (expert)
100%145°45° line

Percent grade vs angle

A 100% grade is 45°, not 90°. Grades grow much faster than angles: an 8.33% ramp (1:12) is only 4.76°, while a 50% slope is 26.6°. Road signs use percent; geometry uses degrees.

Common Slope Questions

How do I get slope-intercept form?

Compute m from the two points, then b = y₁ − m·x₁. The equation is y = mx + b, shown in the result.

What is rise over run?

Another name for slope: rise is the vertical change (Δy), run is the horizontal change (Δx).

Tips and Common Mistakes

  • Subtract in the same order on top and bottom (y₂ − y₁ over x₂ − x₁).
  • Parallel lines have equal slopes; perpendicular slopes multiply to −1.
  • For ramps and roofs, the grade (slope × 100) is usually what codes specify.

Frequently asked questions

How do you find the slope between two points?

Divide the difference in y by the difference in x: m = (y₂ − y₁)/(x₂ − x₁).

What does a negative slope mean?

The line goes down from left to right: y decreases as x increases.

What is the slope of a vertical line?

Undefined, because the run is zero and you cannot divide by zero.

How do you convert slope to an angle?

Take the arctangent: θ = tan⁻¹(m). A slope of 1 is 45°.

Sources and methodology

Last reviewed

byBhuvanesh S. Runs through our automated test suite on every build.

Results are estimates. Double-check anything important before relying on it.