Math

Slope Calculator

Enter two points to get the slope of the line through them, its angle and its equation.

Your numbers

Your results

Slope (m)
Slope (m)
—
Angle with the x-axis (°)
—
y-intercept (b)
—
Line equation
—
Distance between points
—

Slope Calculator by TheCalcTools

How the Slope Calculator works

Enter the coordinates of both points.

Slope is the rise (change in y) divided by the run (change in x).

The intercept is found by substituting one point into y = mx + b.

The formula

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

Worked example

Using the default values shown in the calculator:

x₁1
y₁2
x₂4
y₂8
  1. Rise = 8 − 2 = 6 and run = 4 − 1 = 3, so m = 2.00.
  2. Intercept b = 2 − 2×1 = 0.00, so the line is y = 2.00x + 0.00.
  3. Distance = √(3² + 6²) = 6.7082.

Result:

Slope (m)2.0000
Angle with the x-axis (°)63.43
y-intercept (b)0.0000
Line equationy = 2.00x + 0.00
Distance between points6.7082

Frequently asked questions

What is the slope of a vertical line?

It is undefined, because the run is zero and division by zero is not possible.

What does a negative slope mean?

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

Sources and further reading

More in Math · All calculators

This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.