Slope Calculator
This slope calculator finds the slope of a line from two points, and it gives you the whole picture: the y-intercept, the line equation in y = mx + b form, the angle of incline, and the rise over run. Type the coordinates of two points and you'll see the answer plotted on a little graph, and it's all laid out step by step so the formula sticks.
- Slope from two points
- Line equation
- Angle of incline
- Rise over run
- Live graph
Last updated June 16, 2026 m = (y₂ − y₁) ÷ (x₂ − x₁) Reviewed by the Calcowa math team
Two points on the line
Enter the four coordinates of two points.
m = (8 − 2) ÷ (3 − 1) = 6 ÷ 2 = 3
What is slope?
Slope measures how steep a line is and which way it tilts. It's the amount the line rises for each step it takes across, written as the letter m. A positive slope climbs from left to right, a negative slope falls, a slope of 0 is flat, and a steeper number means a steeper line. You'll find it by comparing two points on the line.
How to find slope from two points
Here's how to find the slope between (1, 2) and (3, 8):
- 1
Find the riseSubtract the y values: 8 − 2 = 6.
- 2
Find the runSubtract the x values in the same order: 3 − 1 = 2.
- 3
DivideRise over run is 6 ÷ 2 = 3, so the slope is 3.
Keep the points in the same order on top and bottom. Flip one but not the other and you'll land on the wrong sign.
Slope-intercept form and the line equation
Once you've got the slope, you can write the whole line as y = mx + b, called slope-intercept form. Here m is the slope and b is the y-intercept, where the line crosses the vertical axis. Plug one point and the slope into the equation to solve for b. For our example the slope is 3, and using (1, 2) gives b = 2 − 3 × 1 = −1, so the line is y = 3x − 1. The calculator builds this equation for you, and it's shown right next to the slope.
Zero, negative, and undefined slopes
A few results catch people out. A horizontal line has a slope of 0, since it doesn't rise. A line that's falling from left to right has a negative slope. A vertical line has an undefined slope, because the run is 0 and you can't divide by zero. The calculator spots each of these and labels it, so you won't be left wondering why the answer looks odd.
Frequently asked questions
Does it matter which point you call the first?
No, as long as you're consistent. Whichever point you pick as the first, use its x and y on the same side of both subtractions. Swapping both top and bottom flips two minus signs, which cancel out and give the same slope.
Take two points on the line and divide the change in y by the change in x. The formula is m = (y₂ − y₁) ÷ (x₂ − x₁), often said as rise over run. For the points (1, 2) and (3, 8), the slope is (8 − 2) ÷ (3 − 1) = 6 ÷ 2 = 3.
It's m = (y₂ − y₁) ÷ (x₂ − x₁). The top is the rise, how far the line goes up or down, and the bottom is the run, how far it goes across. Slope is just rise divided by run between any two points on the line.
Rise is the vertical change between two points and run is the horizontal change, so rise over run is the slope. A slope of 3 means the line climbs 3 units up for every 1 unit across. If the rise is negative, the line's heading downhill.
It's the equation y = mx + b, where m is the slope and b is the y-intercept, the value of y where the line crosses the vertical axis. Once you've got the slope and one point, you can solve for b and write the whole line in this form, which the calculator does for you.
A horizontal line has a slope of 0, because it doesn't rise at all. A vertical line has an undefined slope, since the run is 0 and you can't divide by zero. The calculator flags both of these special cases.
Take the inverse tangent of the slope: angle = arctan(m). A slope of 1 gives a 45-degree incline, and a slope of 3 is about 71.6 degrees. The result above shows this angle, so you'll picture how steep the line really is.
Related calculators
More algebra and geometry tools.
Solve any quadratic equation.
Pythagorean theoremDistance and triangle sides.
All math calculatorsPercent, fractions, averages, more.
Graphing a line?
Type your two points above, or browse the full math hub.