Slope Calculator
Find the slope between two points, along with the line's angle and whether it's rising or falling.
Rise ÷ run = 4 ÷ 3. The line is rising.
Step by step
- m = (y₂ − y₁) / (x₂ − x₁)
- m = (6 − 2) / (4 − 1)
- m = 4 / 3 = 1.333333
How it works
Slope measures how steep a line is. You get it by dividing the change in y (the rise) by the change in x (the run) between two points: m = (y₂ − y₁) / (x₂ − x₁). A slope of 2 means the line climbs 2 units for every 1 unit you move to the right.
The sign tells you the direction. A positive slope rises as you go left to right, a negative slope falls, and a slope of 0 is a flat, horizontal line. This calculator also converts the slope into an angle in degrees using the arctangent, so you can picture the tilt.
One case has no answer: if both points share the same x-value, the run is zero and you'd be dividing by zero. That's a vertical line, and its slope is undefined. Rather than show a wrong number, the tool flags it clearly.
Frequently asked questions
What does an undefined slope mean?
It means the line is vertical — both points have the same x-value, so the run (x₂ − x₁) is zero. Since you can't divide by zero, the slope has no numeric value. A horizontal line, by contrast, has a slope of exactly 0.
Does the order of the two points matter?
No. As long as you subtract the y-values and the x-values in the same order, you get the same slope. Swapping which point is first flips the sign of both the rise and the run, and those cancel out.
How do I turn a slope into an angle?
Take the arctangent of the slope: angle = atan(m), then convert from radians to degrees. A slope of 1 gives 45°, a slope of 0 gives 0°, and steeper slopes approach 90°. The tool does this for you.