Slope Calculator

Two points — the slope, line equation, distance and angle between them.

Slope (m)
2
Line equation
y = 2x + 0
Distance between points
6.708
Angle from horizontal
63.435°

A vertical line (same x for both points) has an undefined slope — there's no rise-over-run ratio when the run is zero.

A worked example

The points (1, 2) and (4, 8) give a slope of exactly 2, with the line equation y = 2x.

Frequently asked questions

What does a negative slope mean?

The line goes downward as you move from left to right — y decreases as x increases. A positive slope means the line rises left to right.

What does a slope of 0 mean?

The line is perfectly horizontal — y stays the same no matter what x is.

Why is a vertical line's slope undefined rather than infinite?

Slope is rise over run — for a vertical line, the run (change in x) is zero, and division by zero is undefined, not a number (even a very large one).