Skip to content

Slope Calculator

Enter two points to find the slope of the line through them, its equation, intercepts, angle, the distance between the points and their midpoint.

Formulas last reviewed: September 2026

Disclaimer: Results are calculated with standard formulas and are meant for learning and quick checks. Please double-check important work, especially anything used for exams, engineering, finance or safety.

How steep is the line?

The slope of a line measures its steepness: how much it rises (or falls) for each step to the right. Two points are enough to find it. A positive slope climbs, a negative slope falls, a zero slope is flat and a vertical line has no defined slope.

Enter two points and this calculator gives the slope, the equation of the line, both intercepts, the angle with the x-axis, the distance between the points and their midpoint.

How it is calculated

m = (y₂ − y₁) ÷ (x₂ − x₁)
y = mx + b, where b = y₁ − m × x₁
Angle = arctan(m)

Worked example

Points (1, 2) and (5, 10)

Rise ÷ run
8 ÷ 4
Slope
2
Equation
y = 2x + 0
Angle
63.43°

Slope in real life

  • Road and ramp gradients are slopes written as a percentage: a slope of 0.08 is an 8% grade.
  • Parallel lines have equal slopes, and perpendicular lines have slopes whose product is −1.
  • In a graph of cost against quantity, the slope is the price per unit.

Frequently asked questions

What is the slope of a vertical line?

It is not defined, because the change in x is zero and you cannot divide by zero. The equation is simply x = a constant.

What is the slope of a horizontal line?

Zero. The y-value never changes, so the equation is y = a constant.

How is slope different from angle?

Slope is the ratio rise ÷ run, and the angle is its inverse tangent. A slope of 1 is a 45 degree angle.

What is the y-intercept?

It is the point where the line crosses the y-axis, the value of y when x is 0.