Slope Calculator
Enter two points to find the slope, the line equation, and the angle.
How to find the slope between two points
The slope measures how steep a line is. Take the change in y (rise) and divide by the change in x (run): m = (y₂ − y₁) / (x₂ − x₁). A positive slope rises left to right, a negative slope falls, a zero slope is horizontal, and a vertical line has an undefined slope.
Frequently asked questions
How do you calculate slope?
Slope is rise over run: m = (y₂ − y₁) / (x₂ − x₁). Subtract the y-values, divide by the difference of the x-values, and you have the slope of the line through the two points.
What is the equation of the line?
Once you know the slope m and one point, the line is y = mx + b, where b is the y-intercept found by substituting a point back into the equation. This calculator shows the full equation.
What is the slope of a vertical line?
A vertical line has an undefined (infinite) slope because the run is zero — you cannot divide by zero. Its equation is written as x = a constant.