About the Slope Calculator
What is the Slope Calculator?
The slope (or gradient) of a line measures how steep it is: how much y changes for each unit change in x, often described as “rise over run”. A positive slope goes up from left to right, a negative slope goes down, zero is flat and a vertical line has an undefined slope.
Enter two points and the calculator finds the slope m, the y-intercept c, the equation y = mx + c and the angle of the line with the x-axis. Slope is used for road and ramp gradients, roof pitch, rates of change and linear trends in data.
How to use the Slope Calculator
- x₁ (sample: 2)
- y₁ (sample: 3)
- x₂ (sample: 6)
- y₂ (sample: 11)
- Press Find Slope (results also refresh as you type). The result card shows the Slope (m), along with Equation of the line, y-intercept (c), Angle with x-axis and Rise ÷ run.
Formula used
m = (y₂ − y₁) ÷ (x₂ − x₁)
- (x₁, y₁), (x₂, y₂) = the two points on the line
- c = the y-intercept, y₁ − m × x₁
- θ = the angle with the x-axis, tan⁻¹(m)
If x₁ = x₂ the line is vertical (x = constant) and its slope is undefined.
Worked example
These are the sample values already filled in the calculator above, and the result it returns for them:
| Input | Sample value |
|---|---|
| x₁ | 2 |
| y₁ | 3 |
| x₂ | 6 |
| y₂ | 11 |
| Result | Value |
|---|---|
| Slope (m) | 2 |
| Equation of the line | y = 2x − 1 |
| y-intercept (c) | -1 |
| Angle with x-axis | 63.4349° |
| Rise ÷ run | 8 ÷ 4 |
Tips for using the Slope Calculator
- A road gradient of 1 in 20 is a slope of 0.05, or 5%.
- Parallel lines have equal slopes; perpendicular lines have slopes whose product is −1.
- The order of the points does not matter, as long as you subtract in the same order on the top and bottom.
