Find the slope, distance between two points, midpoint, and line equation — with every step of the math shown. Works as a standalone distance calculator too.
Slope is the change in y divided by the change in x between two points. This calculator also derives the distance between the points, their midpoint, and the full line equation.
Slope measures how steep a line is and in which direction it moves. A positive slope rises left to right, a negative slope falls, a zero slope is flat, and an undefined slope is vertical.
Example: for points (1,2) and (4,11), slope = (11-2)/(4-1) = 3, distance ≈ 9.49, midpoint = (2.5, 6.5).
| Point 1 | Point 2 | Slope |
|---|---|---|
| (0,0) | (2,4) | 2 |
| (1,2) | (4,11) | 3 |
| (3,5) | (3,9) | Undefined |
What is the slope formula? Slope = (y₂ - y₁) ÷ (x₂ - x₁), the change in y divided by the change in x between two points.
How do you find the slope between two points? Subtract the y-coordinates and the x-coordinates separately, then divide the difference in y by the difference in x. For (1,2) and (4,11), slope = (11-2)/(4-1) = 3.
What does a slope of zero mean? A slope of zero means the line is perfectly horizontal — the y-value doesn't change as x changes.
What does an undefined slope mean? The slope is undefined when the line is perfectly vertical, since the change in x is zero and division by zero is undefined.
How do you find the midpoint between two points? Average the x-coordinates and average the y-coordinates separately: midpoint = ((x₁+x₂)/2, (y₁+y₂)/2).
How do you write the equation of a line from two points? Find the slope first, then substitute one point into y = mx + b and solve for b (the y-intercept).
Example 1 — Positive slope: (1,2) to (4,11) → slope = 3, distance ≈ 9.49, midpoint = (2.5, 6.5).
Example 2 — Negative slope: (0,10) to (5,0) → slope = -2, line equation y = -2x + 10.
Example 3 — Vertical line: (3,5) to (3,9) → slope is undefined since x doesn't change.
Slope is rise divided by run, and the same idea has different names in different fields. A road grade of 5% means a rise of 5 feet for every 100 feet of horizontal distance. Roof pitch is written as rise per 12 inches of run, so 6/12 is a slope of 0.5. Accessibility guidelines in the United States commonly limit ramps to a slope of 1:12, about 8.3%.
| Slope | As a percent grade | As an angle |
|---|---|---|
| 0.05 | 5% | about 2.9° |
| 0.25 | 25% | about 14.0° |
| 1 | 100% | 45° |
Does the order of my two points matter? No, as long as you subtract in the same order for both coordinates. Swapping the points gives the same slope.
How is distance related to slope? Both come from the same two points. Slope gives the steepness, while distance uses the Pythagorean theorem to give the straight-line length between them.