Slope from two points
Slope measures how steep a line is — the rise over the run between any two points on it. Enter two points and this calculator returns the slope, the angle of incline, the y-intercept, the full line equation, and the distance between the points.
The formula
For points (x₁, y₁) and (x₂, y₂), the slope is m = (y₂ – y₁) / (x₂ – x₁) — the change in y divided by the change in x. The angle the line makes with the horizontal is the arctangent of the slope. Once you have m, the intercept is b = y₁ – m x₁, giving the line y = m x + b.
Special cases
A horizontal line has slope zero. A vertical line has an undefined slope, because the run is zero and you cannot divide by it — the calculator flags this and reports the line as x = constant.
Related algebra tools
For the point halfway between the two, use the midpoint calculator; for the straight-line distance alone, the distance formula calculator.
Worked example
Through (1, 2) and (4, 8): the rise is 6 and the run is 3, so m = 2. The intercept is b = 2 – 2(1) = 0, the line is y = 2x, and the incline is about 63.4 degrees.
FAQ
Does point order matter?
No — swapping the two points negates both the rise and the run, so the slope is unchanged. Just keep x and y paired correctly for each point.
What is a negative slope?
It means the line falls from left to right; y decreases as x increases. The steeper the negative value, the sharper the descent.
