Slope Calculator

Calculate the slope and angle of a line between two points.

How this calculator works

Slope measures how steep a line is between two points: m = (y₂ − y₁) ÷ (x₂ − x₁), often described as 'rise over run.' A positive slope rises left to right; a negative slope falls.

The angle from horizontal follows directly from the slope using the arctangent function, converting the ratio into a more intuitive degree measurement.

A vertical line (where both points share the same x-coordinate) has an undefined slope, since the formula would require dividing by zero — this is a real mathematical edge case, not a calculator error.

Example

Between points (1, 2) and (4, 8): slope = (8−2) ÷ (4−1) = 2, which corresponds to an angle of about 63.4° from horizontal.

Frequently asked questions

What does a slope of 0 mean?

A perfectly horizontal line — y doesn't change at all as x increases.

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

Mathematically, division by zero has no defined value at all — calling it 'infinite' is a common informal shorthand, but 'undefined' is the technically accurate term.

How is slope used outside of pure math class?

Grade of a road or ramp, pitch of a roof, rate of change in a data trend line — anywhere a 'steepness' or 'rate' needs a single number, it's fundamentally the same slope calculation.

More Math calculators