Slope Calculator

Find the slope, y-intercept and incline angle of the line through two points.

Result

Slope
2
Y-intercept
0
Angle
63.4349°
Δx
3
Δy
6
Export:

What slope measures

Slope is steepness expressed as a ratio: how much the line rises (or falls) for every unit it moves sideways. It is the change in y divided by the change in x between any two points on the line, often remembered as "rise over run".

A positive slope climbs from left to right, a negative slope descends, a slope of zero is perfectly flat, and a vertical line has no defined slope because its run is zero — dividing by zero is undefined.

The other outputs

From the two points the calculator derives more than the slope:

  • Y-intercept: where the line crosses the y-axis, giving you the full equation y = slope·x + intercept.
  • Angle: the slope converted to degrees from horizontal, useful for ramps, roofs and roads.
  • Δx and Δy: the raw horizontal and vertical changes that the slope ratio is built from.

Common pitfalls

Be consistent about the order of subtraction. Whatever point you treat as "first" for y, use the same one for x; mixing the order flips the sign of the slope.

If you get a vertical-line error, the two points share the same x-value, so the line goes straight up. Choose points with different x-values, or describe the line as x = constant instead.

Formula

slope = (y₂ − y₁) / (x₂ − x₁); intercept = y₁ − slope·x₁; angle = atan(slope)

Frequently asked questions

What does an error about a vertical line mean?
When the two points share the same x-value the line is vertical, so the slope is undefined (division by zero). Use two points with different x-values.