Skip to content
HappyCalcz

Slope Calculator

Find the slope of the line through two points. Enter the coordinates to see the slope as a decimal and a fraction, the y-intercept, the line's equation in y = mx + b form, its angle, and the distance between the points.

Slope (m)

2

As a fraction
2
y-intercept (b)
1
Equation
y = 2x + 1
Angle
63.43°
Distance
6.7082

Results are estimates for information only and do not constitute financial, medical, or legal advice.

How slope is calculated

Slope is "rise over run": how much y changes divided by how much x changes between the two points. Once you know the slope, plug one point into y = mx + b to find b, where the line crosses the y-axis.

The formulas

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

b = y₁ − m × x₁

Worked example

Find the slope of the line through (1, 3) and (4, 9).

  1. Rise: 9 − 3 = 6. Run: 4 − 1 = 3.
  2. Slope: 6 ÷ 3 = 2.
  3. Intercept: 3 − 2 × 1 = 1, so the equation is y = 2x + 1.

Frequently asked questions

What does the slope tell me?

How steep the line is and which way it goes. A positive slope rises from left to right, a negative slope falls, a slope of 0 is a flat (horizontal) line, and a vertical line has no defined slope. A slope of 2 means the line goes up 2 units for every 1 unit to the right.

Why is the slope of a vertical line undefined?

Because both points have the same x, so the run (x₂ − x₁) is 0, and you cannot divide by 0. The equation of a vertical line is x = a number, like x = 4.

Does the order of the points matter?

No. Swapping the two points changes the sign of both the rise and the run, so the slope stays the same. Just keep each x with its own y.