Slope Calculator

Enter two points (x₁, y₁) and (x₂, y₂) to get the slope and everything else about the line through them.

Two points

Slope (m)2
Equation (slope-intercept form)
y = 2x
y-intercept (b)
0
x-intercept
0
Angle with the x-axis
63.4349°
Distance between points
6.7082039325

Working

  1. Rise: y₂ − y₁ = 8 − 2 = 6
  2. Run: x₂ − x₁ = 4 − 1 = 3
  3. Slope: m = 6 ÷ 3 = 2
  4. Intercept: b = y₁ − m·x₁ = 2 − 2 × 1 = 0

The slope formula

m = (y₂ − y₁) ÷ (x₂ − x₁)

m
slope (rise over run)
(x₁, y₁), (x₂, y₂)
the two points

Once you have the slope, the y-intercept is b = y₁ − m·x₁, giving the line y = mx + b. The angle the line makes with the x-axis is arctan(m).

Worked example

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

  1. Rise: 8 − 2 = 6
  2. Run: 4 − 1 = 3
  3. Slope: 6 ÷ 3 = 2
  4. Intercept: b = 2 − 2 × 1 = 0

The line is y = 2x, rising at about 63.43°.

Interpreting slope

SlopeMeaning
PositiveLine rises from left to right
NegativeLine falls from left to right
0Horizontal line (y = constant)
UndefinedVertical line (x₁ = x₂)

Slope is also used as a grade: a slope of 0.08 is an 8% gradient, meaning 8 units of rise for every 100 units of horizontal distance.