Slope Calculator

Calculate the slope of the line through two points (x₁,y₁) and (x₂,y₂), along with its equation and the angle of inclination relative to the X axis.

How is it calculated?

Slope: m = (y₂ − y₁) ÷ (x₂ − x₁). Y-intercept: b = y₁ − m × x₁, giving the line's equation y = mx + b. Angle of inclination: arctangent of the slope, in degrees. If x₁ = x₂, the line is vertical and the slope is undefined (division by 0).

Examples

  • Line through (1, 2) and (4, 8)

    Slope = 2, equation y = 2x, angle ≈ 63.43°.

  • Horizontal line through (0, 5) and (3, 5)

    Slope = 0 (horizontal line), equation y = 5.

  • Vertical line through (2, 0) and (2, 7)

    Undefined slope (vertical line), equation x = 2.

The three line types by slope

SlopeLine typeAngle
PositiveGoes up from left to rightBetween 0° and 90°
NegativeGoes down from left to rightBetween 0° and −90°
ZeroHorizontal0°
UndefinedVertical90°

Frequently asked questions

Related calculators

We use analytics cookies to understand which calculators are useful. They are never used for advertising. More information in our privacy policy.