Slope Calculator

The slope of a line measures how steep it is: the rise in y for each step in x. With two points you also get the full equation of the line.

Results update as you type.

Slope (m)

2

rise 6 over run 3

Equation
y = 2x
Angle with the x-axis
63.43494882°
x-intercept
0

About this calculator

A vertical line has an undefined slope.

How to use it

  1. Enter the first point.
  2. Enter the second point.
  3. Read the slope and equation.

The formula

m = (y₂ − y₁) ÷ (x₂ − x₁); c = y₁ − m x₁
m
slope
c
y-intercept

Worked example

Points (1, 2) and (4, 8)

  1. m = (8 − 2) ÷ (4 − 1) = 2.
  2. c = 2 − 2 × 1 = 0, so y = 2x.
  3. Angle with the x-axis ≈ 63.43°.

What the result means

Parallel lines have equal slopes; perpendicular slopes multiply to −1.

Slope, angle and percentage gradient

A 1 in 20 ramp has a slope of 0.05, a 5% gradient and an angle of only about 2.86°.

Angle = tan⁻¹ m; gradient % = m × 100
Slope mAngle with the x-axisGradient
00°0%
0.05 (1 in 20)≈ 2.86°5%
0.1 (1 in 10)≈ 5.71°10%
0.5≈ 26.57°50%
145°100%
√3 ≈ 1.73260°≈ 173.2%
2≈ 63.43°200%
−1−45°−100%

Worked example with a negative slope

  • Points (−2, 5) and (4, −1).
  • m = (−1 − 5) ÷ (4 − (−2)) = −6 ÷ 6 = −1.
  • c = 5 − (−1)(−2) = 5 − 2 = 3, so y = −x + 3. The calculator writes this as y = −1x + 3.
  • Setting y = 0 gives the x-intercept 3. The angle with the x-axis is −45°.

Mistakes to avoid

  • Mixing the order of the points: (8 − 2) ÷ (1 − 4) = −2 has the wrong sign. Subtract in the same order on top and bottom.
  • Confusing horizontal and vertical lines: y = 4 has slope 0, while x = 2 has an undefined slope.
  • Reading m from an equation not in y = mx + c form: rewrite 2x + 3y = 6 as y = −(2/3)x + 2, so m = −2/3.

Assumptions

  • Any two different points; for a vertical line the slope is undefined.

Limitations

  • Results are rounded to 10 significant figures.

Frequently asked questions

What is slope?

Rise over run: the change in y divided by the change in x.

What is the slope of a horizontal line?

0.

What is a negative slope?

The line falls from left to right.

What is the slope of y = 3x + 2?

3. In y = mx + c the coefficient of x is the slope, and 2 is the y-intercept.

What is the slope of a line perpendicular to one with slope 2?

−1/2, because perpendicular slopes multiply to −1.

How do I find the slope from an angle?

Take the tangent: m = tan θ. A line at 45° has slope 1, and a line at 60° has slope √3 ≈ 1.732.

Last reviewed on 12 October 2026. How we calculate and check. Found a mistake? Tell us.