MultiConvers

Slope Calculator

Enter two points, or a rise and a run, to get the slope and the angle from the positive x-axis.

A vertical line is called undefined — the page does not print Infinity.

How it works

Slope is rise over run: m = (y₂ − y₁) / (x₂ − x₁). It is a ratio of two lengths in the same unit, so it is dimensionless. A horizontal line has slope 0.

A vertical line has no finite slope because the run is 0; that case is labeled undefined. The angle shown is arctan(m) in degrees, or 90° when the line is vertical. Two identical points do not determine a line.

Formula

m = (y₂ − y₁) / (x₂ − x₁)
m = rise / run
θ = arctan(m)

Worked examples

  • Two points

    (1, 2) to (3, 6) slope 2

  • A vertical line

    (2, 1) to (2, 8) undefined (vertical)

Useful notes

  • Coordinates are unitless here — only their ratio matters.
  • For the distance between the same two points, use the distance calculator.

FAQ

How do I find the slope of a line?

Subtract the y-coordinates and divide by the difference of the x-coordinates. From (1, 2) to (3, 6) the slope is 4/2 = 2.

What is the slope of a vertical line?

It is undefined. Division by zero is not a number, so this tool does not show Infinity.

Is slope the same as the angle?

No. Slope is rise/run. The angle is arctan of that ratio, measured from the positive x-axis.

Related tools

See all Geometry tools.