Slope Calculator
Find the slope, y-intercept, and line equation from two points.
rise ÷ run = 6 ÷ 3 · y-intercept b = 0 · y = 2x
The slope between two points is the rise divided by the run: m = (y₂ − y₁) ÷ (x₂ − x₁). For the points (1, 2) and (4, 8), the rise is 6 and the run is 3, so the slope is 2. The line through them is y = 2x.
What slope measures
Slope is how steeply a line rises or falls — the change in y for every one-unit change in x. Pick any two points on the line, divide the vertical change (the rise) by the horizontal change (the run), and you have the slope. A slope of 2 means the line climbs 2 units up for each 1 unit you move right; a slope of −½ means it drops half a unit for each step right.
rise over run; the run (x₂ − x₁) must be non-zero, or the line is vertical and the slope is undefined
Worked example
Find the slope and equation of the line through (1, 2) and (4, 8):
- 1 Label the points. Let (x₁, y₁) = (1, 2) and (x₂, y₂) = (4, 8).
- 2 Find the rise and run. Rise = y₂ − y₁ = 8 − 2 = 6. Run = x₂ − x₁ = 4 − 1 = 3.
- 3 Divide to get the slope. m = rise ÷ run = 6 ÷ 3 = 2.
- 4 Solve for the y-intercept. b = y₁ − m·x₁ = 2 − (2)(1) = 0.
- 5 Write the equation. y = mx + b = 2x + 0, so y = 2x.
What the sign of the slope tells you
The slope’s sign and size describe the line’s direction and steepness.
| Slope (m) | Direction of the line | Example |
|---|---|---|
| Positive (m > 0) | Rises from left to right | m = 2 → y = 2x |
| Negative (m < 0) | Falls from left to right | m = −½ → y = −½x + 3 |
| Zero (m = 0) | Horizontal line | y = 4 |
| Undefined | Vertical line (run = 0) | x = 5 |
Parallel, perpendicular, and other line forms
Parallel lines have equal slopes. Two lines never meet exactly when they share the same slope but different intercepts — for example y = 2x + 1 and y = 2x − 4.
Perpendicular lines have negative-reciprocal slopes. If one line has slope m, a line at a right angle to it has slope −1 ÷ m. A line with slope 2 is perpendicular to a line with slope −½, because 2 × (−½) = −1.
Point-slope form writes a line straight from one point and the slope: y − y₁ = m(x − x₁). Rearranging it gives the slope-intercept form y = mx + b that this tool reports.