Slope of a line through two points
The slope (or gradient) measures how steeply a line rises or falls between two points. This tool returns the slope, the line equation and the line’s angle — for students, surveyors and anyone working with linear graphs or gradients.
How it works
The slope is the change in y divided by the change in x, often called “rise over run”:
m = (y₂ − y₁) ÷ (x₂ − x₁)
From the slope and one point, the y-intercept is b = y₁ − m × x₁, giving the
line equation y = mx + b. The angle of the line is atan2(Δy, Δx) converted
to degrees. A positive slope rises left to right, a negative slope falls, a slope
of 0 is horizontal, and a vertical line has an undefined slope because the run
is zero — the tool reports this rather than dividing by zero.
Example
For the points (1, 2) and (4, 8):
| Result | Value |
|---|---|
| Δy / Δx | 6 ÷ 3 |
| Slope (m) | 2 |
| Equation | y = 2x + 0 |
| Angle | ≈ 63.43° |
All calculations run in your browser, with nothing uploaded.