Slope Calculator
Enter two points, or one point and a slope or angle, to get the slope, the equation of the line in several forms, its intercepts and the working.
How to use the Slope Calculator
- Pick what you want to work out using the tabs: Two points or Point and slope.
- Enter x₁.
- Enter y₁.
- Enter x₂.
- Enter y₂.
- Read your answer in the results panel. It updates as you type, and the breakdown, step-by-step working and any charts or tables appear below it.
- Use Share link to save or send the exact calculation, or Copy to paste the results elsewhere.
The slope formula
Slope measures how steep a line is: how much y changes for each step of 1 in x. Between two points (x₁, y₁) and (x₂, y₂):
m = (y₂ − y₁) ÷ (x₂ − x₁) = rise ÷ run
A positive slope rises from left to right, a negative slope falls, zero slope is horizontal, and a vertical line has no defined slope because the run is zero.
Worked example
Through (3, −2) and (−1, 4): rise = 4 − (−2) = 6 and run = −1 − 3 = −4, so m = 6 ÷ −4 = −3/2 = −1.5. The y-intercept is b = y₁ − m·x₁ = −2 − (−1.5)(3) = 2.5, giving y = −1.5x + 2.5. In standard form with whole numbers that is 3x + 2y = 5. The line crosses the x-axis where y = 0, at x = 5/3 ≈ 1.667.
Forms of a line equation
| Form | Shape | Best for |
|---|---|---|
| Slope-intercept | y = mx + b | graphing and reading off the slope |
| Point-slope | y − y₁ = m(x − x₁) | writing a line through a known point |
| Standard | Ax + By = C | whole-number coefficients, systems of equations |
Slope, angle and grade
The angle a line makes with the x-axis is θ = arctan(m). A slope of 1 is 45°; a slope of 2 is about 63.4°. Road and ramp signs use grade, which is the slope as a percentage: a 6% grade rises 6 units per 100 units across, a slope of 0.06 and an angle of only about 3.4°. Do not confuse percentage grade with degrees.
Point and slope mode
If you know one point and the slope (or the angle), the second tab writes the equation and finds the two points a chosen distance away along the line, using (x₁ ± d·cos θ, y₁ ± d·sin θ). That is handy for plotting or for laying out a straight path.
Parallel and perpendicular lines
Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, so the perpendicular slope is −1/m. A line with slope 2 is perpendicular to one with slope −0.5.
Frequently asked questions
How do you find the slope from two points?
Subtract the y-values, subtract the x-values in the same order, and divide: m = (y₂ − y₁) ÷ (x₂ − x₁). From (1, 2) to (4, 8) that is 6 ÷ 3 = 2.
What is the slope of a vertical line?
It is not defined, because the run is zero and you cannot divide by zero. The equation of a vertical line is x = constant.
How do I convert slope to an angle?
Take the arctangent: θ = arctan(m). A slope of 0.5 is about 26.57°.
What does a slope of zero mean?
The line is horizontal: y stays the same whatever x is. Its equation is y = b.