LineLab
Slope & Distance Calculator
Drop in two points — get slope, distance, midpoint, and the y = mx + b equation of the line through them.
Slope, distance and midpoint between two points
Slope is the rise over the run, distance comes from Pythagoras, and the line equation is y = mx + b.
| Point 1 | Point 2 | Distance | Slope | Midpoint | Intercept b |
|---|---|---|---|---|---|
| (0, 0) | (3, 4) | 5.0000 | 1.3333 | (1.50, 2.00) | 0.0000 |
| (0, 0) | (6, 8) | 10.0000 | 1.3333 | (3.00, 4.00) | 0.0000 |
| (1, 2) | (5, 10) | 8.9443 | 2.0000 | (3.00, 6.00) | 0.0000 |
| (1, 1) | (4, 10) | 9.4868 | 3.0000 | (2.50, 5.50) | -2.0000 |
| (2, 3) | (8, 3) | 6.0000 | 0.0000 | (5.00, 3.00) | 3.0000 |
| (-2, -3) | (4, 5) | 10.0000 | 1.3333 | (1.00, 1.00) | -0.3333 |
Rows one, two and six share a slope of 1.3333 while their distances range from 5 to 10 - slope describes direction only, so parallel lines of any length give the same value. Row five is horizontal, so the slope is zero and the intercept equals the shared y value. A vertical line would have an undefined slope, since the run is zero and the division is impossible. The 3-4-5 and 6-8-10 rows give whole-number distances because those are Pythagorean triples; most point pairs do not.
Quick formulas
Slope m = (y₂ − y₁) / (x₂ − x₁). Distance d = √((x₂ − x₁)² + (y₂ − y₁)²). Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2).
Frequently asked questions
How do I find the slope between two points?
Slope m = (y₂ − y₁) / (x₂ − x₁). For points (2, 3) and (6, 11): m = (11 − 3) / (6 − 2) = 8/4 = 2. A positive slope goes up-right, negative goes down-right, zero is horizontal, and undefined (division by zero) is vertical.
How do I find the equation of a line from two points?
First find the slope: m = (y₂ − y₁) / (x₂ − x₁). Then use point-slope form: y − y₁ = m(x − x₁). Convert to slope-intercept: y = mx + b. For points (1, 2) and (3, 8): m = 3, so y − 2 = 3(x − 1) → y = 3x − 1.
What does a slope of 0 vs undefined mean?
Slope 0 = horizontal line (y doesn't change as x changes, like y = 5). Undefined slope = vertical line (x doesn't change, like x = 3). You can't write a vertical line in y = mx + b form because the slope would require division by zero.
Related Math calculators
You might also like
Down Payment Calculator
FinanceDown payment amount, loan size, and monthly payment for any home price.
OpenDebt Payoff Calculator
FinanceHow long to pay off a debt and total interest from balance, APR, and payment.
OpenHome Affordability Calculator
FinanceMaximum home price you can afford based on income, debts, and interest rate.
OpenLast updated: September 6, 2026