Math

Slope Calculator

Enter the coordinates of two points to calculate the slope of the line between them, along with the full equation in slope-intercept form (y = mx + b).

Point 1

Point 2

Slope (m)
—
Enter two points to calculate.

How the Slope formula works

The slope formula, then solving for the y-intercept:

m = (y₂ − y₁) / (x₂ − x₁)
b = y₁ − m × x₁

Step-by-step calculation

  1. Subtract the y-coordinates and the x-coordinates of the two points.
  2. Divide the change in y by the change in x to get the slope, m.
  3. Substitute the slope and one point's coordinates into y = mx + b, and solve for b.

Worked example

Points (2, 3) and (6, 11): slope = (11 − 3) / (6 − 2) = 8/4 = 2. Using point (2,3): 3 = 2(2) + b, so b = −1. The line's equation is y = 2x − 1.

Frequently asked questions

What does a negative slope mean?

A negative slope means the line goes downward as x increases — the two variables move in opposite directions. A positive slope means the line rises as x increases.

What if both points have the same x-coordinate?

That produces a vertical line, which has an undefined slope, since the change in x is zero and division by zero isn't defined — the calculator will flag this case.