Slope from two points, slope-intercept form, angle, distance, and midpoint
Slope is rise over run: m = (y₂ − y₁) / (x₂ − x₁). For the points (2, 3) and (6, 11), that's (11 − 3) / (6 − 2) = 2, and the y-intercept works out to b = 3 − 2(2) = −1, so the line is y = 2x − 1. A perpendicular line would have slope −1/2, and the angle of the line is arctan(2) ≈ 63.4°. Vertical lines have undefined slope; horizontal lines have slope 0.
| Slope (m) | Common Name | Angle | Percent Grade |
|---|---|---|---|
| 1/12 (0.083) | ADA ramp maximum | 4.8° | 8.3% |
| 1/4 (0.25) | Steep residential street | 14.0° | 25% |
| 1/3 (0.333) | — | 18.4° | 33.3% |
| 1/2 (0.5) | 6/12 roof pitch | 26.6° | 50% |
| 1 | 45° line | 45.0° | 100% |
| 2 | — | 63.4° | 200% |
| 3 | — | 71.6° | 300% |
Angle = arctan(m) and percent grade = m × 100, so the two columns are just different lenses on the same number. Roofers quote rise per 12 inches of run; road engineers quote percent grade; math class uses plain m.
Slope measures how fast a line climbs: how much y changes for each unit x moves. Enter any two points on the line and this calculator returns the slope, the full equation in slope-intercept form, and everything else the line determines: its angle, its y-intercept, the distance and midpoint between your two points, and the slope any perpendicular line would need.
Slope: m = (y₂ − y₁) / (x₂ − x₁). Y-intercept: b = y₁ − m·x₁ (plug in either point). Slope-intercept form: y = mx + b. Point-slope form: y − y₁ = m(x − x₁). Distance: √((x₂ − x₁)² + (y₂ − y₁)²). Midpoint: ((x₁ + x₂)/2, (y₁ + y₂)/2). Perpendicular slope: −1/m, and parallel lines keep the same m.
Type the coordinates of your two points. Everything updates live, including the graph. The order of the points doesn't matter, but keep the pairs intact: point 1 is (x₁, y₁), point 2 is (x₂, y₂). If both x-values are equal you'll get "undefined" — that's a vertical line, x = that value, and it genuinely has no slope-intercept form.
Take (2, 3) and (6, 11). Rise = 11 − 3 = 8. Run = 6 − 2 = 4. Slope = 8/4 = 2, a positive slope: the line climbs 2 units for every 1 unit it runs right. The y-intercept: b = 3 − 2(2) = −1, so y = 2x − 1. The distance between the points is √(4² + 8²) = √80 ≈ 8.94, the midpoint is (4, 7), the angle is arctan(2) ≈ 63.4°, and any perpendicular line has slope −1/2.
One more with a negative slope: (−1, 7) and (4, −8). Rise = −8 − 7 = −15, run = 4 − (−1) = 5, slope = −3. Then b = 7 − (−3)(−1) = 4, giving y = −3x + 4. Negative slopes always fall as x increases, and this one is steep: 71.6° below horizontal.
Slope is rise over run: m = (y₂ − y₁) / (x₂ − x₁). Subtract the y-coordinates, subtract the x-coordinates in the same order, and divide. For (2, 3) and (6, 11), that's (11 − 3) / (6 − 2) = 8 / 4 = 2. The order of the two points doesn't matter as long as you stay consistent.
First find the slope m, then plug either point into b = y − mx. With slope 2 and the point (2, 3): b = 3 − 2(2) = −1. The full line is y = 2x − 1, which crosses the y-axis at (0, −1).
A horizontal line has slope 0 (the y-values never change, so the numerator is 0). A vertical line has an undefined slope: the x-values are equal, the denominator is 0, and dividing by zero has no meaning. A vertical line's equation is x = a, which can't be written in y = mx + b form.
Flip the slope and change its sign: the perpendicular slope is −1/m. A line with slope 2 has perpendicular slope −1/2, and a line with slope −3 has perpendicular slope 1/3. Horizontal and vertical lines are perpendicular to each other, which is why the rule breaks down at m = 0 (there is no −1/0).
Angle = arctan(m). A slope of 1 is 45 degrees, slope 2 is 63.4 degrees, and slope 0.5 is 26.6 degrees. Percent grade is just m × 100, so slope 0.08 is an 8% grade, the steep end of a highway descent. Roofs and ramps usually quote rise per 12 inches of run: 6/12 pitch means m = 6/12 = 0.5.
Yes. Parallel lines (that aren't the same line) always have identical slopes and different y-intercepts: y = 2x − 1 and y = 2x + 5 never meet. Perpendicular lines, by contrast, have slopes that multiply to −1: 2 × (−1/2) = −1.