Slope Calculator
Enter two points to calculate the slope (rise over run), the y-intercept, the equation of the line and its angle of inclination.
| Slope (m) | 2 |
|---|---|
| Equation of the line | y = 2x − 1 |
| y-intercept (b) | -1 |
| Angle of inclination | 63.43 ° |
| Grade | 200.0% |
Link to this calculation – copied!
Formula
b = y1 − m × x1
θ = arctan(m)
| Symbol | Meaning |
|---|---|
| m | Slope (gradient) of the line |
| b | y-intercept, where the line crosses the y-axis |
| θ | Angle of the line measured from the positive x-axis |
How to Use This Calculator
- Enter the x₁.
- Enter the y₁.
- Enter the x₂.
- Enter the y₂.
- Press Calculate. Results also update automatically as you type.
Worked Example
Using the values pre-filled in the calculator above:
| x₁ | 2 |
|---|---|
| y₁ | 3 |
| x₂ | 6 |
| y₂ | 11 |
| Slope (m) | 2 |
|---|---|
| Equation of the line | y = 2x − 1 |
| y-intercept (b) | -1 |
| Angle of inclination | 63.43 ° |
| Grade | 200.0% |
About This Calculation
The slope of a line measures how steep it is: how much y changes for every one-unit step in x. It is often described as "rise over run". A positive slope climbs from left to right, a negative slope falls, a slope of zero is a horizontal line, and a vertical line has an undefined slope because the run is zero.
Once you know the slope, the y-intercept follows from either point, giving the slope-intercept equation y = mx + b. That equation lets you predict y for any x, check whether a third point lies on the same line, or compare lines: parallel lines share the same slope, and perpendicular lines have slopes whose product is −1. The slope is also a rate — in a graph of distance against time it is speed; in a graph of cost against quantity it is the price per unit.
Slope is expressed in different ways in different fields. Road signs and wheelchair ramps use grade, the slope as a percentage (a 1:12 ramp is an 8.3% grade). Roofers talk about pitch, such as 6-in-12. Surveyors and engineers often quote the angle of inclination instead, which is the arctangent of the slope. Note that a 100% grade is a 45° angle, not a vertical wall.
Frequently Asked Questions
- Does it matter which point I enter first?
- No. Swapping the points changes the sign of both the rise and the run, so their ratio — the slope — stays the same.
- What is the slope of a vertical line?
- It is undefined, because the run (change in x) is zero and you cannot divide by zero. Its equation is simply x = constant.
- How is slope related to the angle?
- The slope is the tangent of the angle the line makes with the x-axis, so θ = arctan(m). A slope of 1 is 45°, and a slope of 0.5 is about 26.6°.