This slope calculator finds the slope of a line from any two points using the slope formula m = (y₂ − y₁) / (x₂ − x₁). Slope measures steepness as "rise over run" — how much the line goes up (or down) for every unit it moves to the right.
Along with the slope, the calculator gives you the full picture of the line: the y-intercept, the equation in slope-intercept form (y = mx + b), the point-slope form, the angle of incline in degrees, and the straight-line distance between your two points. If the coordinates are whole numbers, the slope is also shown as a reduced fraction.
The Slope Formula, Step by Step
Given two points (x₁, y₁) and (x₂, y₂), the slope is:
m = (y₂ − y₁) / (x₂ − x₁)
The numerator is the rise (vertical change) and the denominator is the run (horizontal change). Once you have m, the y-intercept follows from b = y₁ − m·x₁, giving the slope-intercept equation y = mx + b.
The point-slope form, y − y₁ = m(x − x₁), is often more convenient when you know one point and the slope but do not need the intercept. The angle of incline is θ = arctan(m), and the distance between the points comes from the Pythagorean theorem: d = √((x₂ − x₁)² + (y₂ − y₁)²).
Interpreting Slope Values
The sign and size of the slope tell you the direction and steepness of the line:
- Positive slope: the line rises from left to right (m = 2 means up 2 for every 1 across).
- Negative slope: the line falls from left to right.
- Zero slope: a horizontal line (y₂ = y₁), with equation y = b.
- Undefined slope: a vertical line (x₂ = x₁) — the run is zero, and division by zero is undefined.
- Slope of 1 corresponds to a 45° incline; slopes between 0 and 1 are shallower, slopes above 1 are steeper.
In real-world grading, slope is often quoted as a percent: a 0.10 slope is a 10% grade, common as a maximum on highways.
Worked Example: Points (2, 1) and (6, 9)
Find the line through (2, 1) and (6, 9).
- Rise: y₂ − y₁ = 9 − 1 = 8. Run: x₂ − x₁ = 6 − 2 = 4.
- Slope: m = 8 / 4 = 2.
- Y-intercept: b = y₁ − m·x₁ = 1 − 2(2) = −3.
- Equation: y = 2x − 3. Point-slope form: y − 1 = 2(x − 2).
- Angle of incline: arctan(2) ≈ 63.43°.
- Distance: √(4² + 8²) = √80 ≈ 8.944.
Check the answer by plugging in the second point: y = 2(6) − 3 = 9. It matches, so the equation is correct.
Frequently Asked Questions
What is the slope formula?
The slope formula is m = (y₂ − y₁) / (x₂ − x₁), where (x₁, y₁) and (x₂, y₂) are any two points on the line. Subtract the y-coordinates for the rise, subtract the x-coordinates in the same order for the run, then divide rise by run.
What is point-slope form?
Point-slope form is y − y₁ = m(x − x₁), where m is the slope and (x₁, y₁) is any known point on the line. It is the quickest way to write a line’s equation when you know one point and the slope, and it converts to y = mx + b by distributing m and solving for y.
Why is the slope of a vertical line undefined?
For a vertical line, both points share the same x-coordinate, so the run (x₂ − x₁) is zero. The slope formula would require dividing by zero, which is undefined in mathematics. A vertical line is written as x = c instead of y = mx + b.
What does a slope of 0 mean?
A slope of 0 means the line is perfectly horizontal — the y-value never changes no matter how far you move along x. Its equation is simply y = b, where b is the constant y-value. This happens whenever the two points have identical y-coordinates.
How do I convert slope to an angle or a percent grade?
The angle of incline is arctan(m) in degrees, so a slope of 1 is 45° and a slope of 0.5 is about 26.57°. Percent grade is the slope times 100: a slope of 0.08 is an 8% grade, meaning the road rises 8 feet for every 100 feet of horizontal distance.