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
Distance Calculator
Find the straight-line distance between two points in a plane or in 3-D space.
Pythagorean Theorem
Find the hypotenuse from two legs, or a missing leg from the hypotenuse and the other leg.
Right Triangle
From two legs, or a leg and the hypotenuse, get the third side, both acute angles, area and perimeter.
Triangle Calculator
Find a triangle’s area, perimeter and angles from three sides, or the area from base and height or SAS.
See all Geometry tools.