Slope between two points:
rise over run, signs and vertical lines
One subtraction on top, one on the bottom, and a division. The only real skill is keeping the order of the points consistent.
Calcylator Editorial Team
Updated · 5 min read
What slope tells you about a line
Slope is a single number for how steeply a straight line climbs or falls as you move from left to right. A slope of 2 means that for every 1 unit you move across, the line rises 2 units. A slope of −0.5 means it drops half a unit for every unit across.
Given two points on the line, you have everything you need. The line is fixed by those two points, and the slope is the same wherever you measure it along that line. That constancy is what makes a straight line straight.
Slope appears far beyond the maths class. Road gradients, roof pitches, the trend of a graph of sales over months and the rate of change in a physics experiment are all slopes with a unit attached.
The slope formula and the order rule
- (x₁, y₁):
- the first point
- (x₂, y₂):
- the second point
- y₂ − y₁:
- rise, the vertical change
- x₂ − x₁:
- run, the horizontal change
The rule that causes errors is order. If you take y₂ − y₁ on top, you must take x₂ − x₁ below. Subtracting the first point from the second in the numerator and the second from the first in the denominator flips the sign of the answer.
Point 1
(2, 3)
Point 2
(6, 11)
Slope
m = 2
Rise = 11 − 3 = 8. Run = 6 − 2 = 4. m = 8 ÷ 4 = 2.
Check with the other order: (3 − 11) ÷ (2 − 6) = (−8) ÷ (−4) = 2. The same result confirms the arithmetic.
Slope is also the ratio that does not change as you pick different pairs of points on the same line. Take (2, 3), (4, 7) and (6, 11): the first pair gives 4 ÷ 2 = 2 and the second pair gives 4 ÷ 2 = 2 as well. If three points give different slopes between the pairs, they do not lie on one line, which is a quick test for collinearity.
Reading the sign and size of the slope
| Slope | The line | Example |
|---|---|---|
| Positive | Rises left to right | m = 2 |
| Negative | Falls left to right | m = −1 |
| Zero | Horizontal, flat | m = 0 |
| Undefined | Vertical, no run | x = 4 |
| Large size | Steep | m = 10 or −10 |
| Small size | Gentle | m = 0.1 or −0.1 |
Point 1
(1, 7)
Point 2
(5, 3)
Slope
m = −1
Rise = 3 − 7 = −4. Run = 5 − 1 = 4. m = −4 ÷ 4 = −1, so the line drops 1 for every 1 across.
A common check is to look at the points. If the second point is to the right and higher, the slope must be positive. If your calculation says negative, there is a sign error somewhere.
Vertical and horizontal lines
Two special cases break the usual routine. If both points share the same y-value, the rise is 0 and the slope is 0: the line is horizontal. For (2, 5) and (9, 5), the slope is 0 ÷ 7 = 0.
If both share the same x-value, the run is 0 and the formula asks for a division by zero. This has no answer, so the slope is called undefined. The line x = 4 is vertical, and no number describes how steep it is, because it is as steep as a line can be.
From slope to angle and percent grade
Slope converts to an angle using the inverse tangent: angle = arctan(m). A slope of 2 corresponds to an angle of 63.43° above the horizontal, and a slope of −1 corresponds to −45°.
Road and ramp gradients are quoted as a percentage, which is the slope multiplied by 100. A slope of 0.08 is an 8% grade, about 4.57°. The two measures feel different: a 100% grade is a 45° slope, not a vertical wall.
Rise
1.5 m
Run
12 m
Grade and angle
12.5% grade; about 7.13°
m = 1.5 ÷ 12 = 0.125 and arctan(0.125) = 7.13°. Accessibility rules for ramps set a maximum grade; check the figure for your locality.
Slope as a rate of change
When the axes carry units, the slope carries a unit too: the unit of y per unit of x. Plot the temperature of a room against time and a slope of 2 means 2 °C per hour. Plot distance against time and the slope is speed. Plot cost against quantity and it is the price per item.
This is the most useful way to read the number. Suppose a taxi fare is ₹40 after 2 km and ₹100 after 6 km. The slope is (100 − 40) ÷ (6 − 2) = ₹15 per km. The line also tells you something about the starting charge: going back to 0 km, the fare would be 40 − 2 × 15 = ₹10, a fixed starting fee.
Point 1 (km, fare)
(2, ₹40)
Point 2 (km, fare)
(6, ₹100)
Rate per km
₹15 per km
Rise = 100 − 40 = 60. Run = 6 − 2 = 4. 60 ÷ 4 = 15. Real tariffs are often stepped, so treat a straight line as an approximation.
Two points are enough only when the relationship is really a straight line. With noisy measurements you would fit a line through many points, and the slope of that best-fit line is the average rate.
Roofs, stairs and ramps
Builders quote slope in their own style. A roof pitch of 6 in 12 means 6 units of rise for every 12 of run, so m = 0.5 and the angle is 26.57°. A staircase with a 175 mm rise and 250 mm going has a slope of 0.7, about 35°.
| Quoted as | Slope m | Angle | Percent grade |
|---|---|---|---|
| 1 in 12 | 0.0833 | 4.76° | 8.3% |
| 1 in 20 | 0.05 | 2.86° | 5% |
| 6 in 12 | 0.5 | 26.57° | 50% |
| 1 : 1 | 1 | 45° | 100% |
Notice that percent grade and angle are not proportional. A 100% grade is 45°, not 90°. Lines steeper than 45° have grades above 100%, and a vertical line has no grade at all.
What slope lets you say about two lines
- Parallel lines have equal slopes. A line through (0, 1) with m = 2 is parallel to one through (3, 0) with m = 2.
- Perpendicular lines have slopes that multiply to −1, so the perpendicular to m = 2 has slope −1/2.
- Once you have m and one point, the line is y − y₁ = m(x − x₁), which rearranges to y = mx + c.
A slope calculator lets you check these relationships quickly, especially when the points have fractions or decimals and doing the subtraction by hand invites a slip.
Common questions
What is the slope formula?
Slope is (y₂ − y₁) divided by (x₂ − x₁). For points (2, 3) and (6, 11), that is 8 ÷ 4 = 2. Use the same point order in the numerator and denominator, or the sign will be wrong.
What does a negative slope mean?
A negative slope means the line falls as you move from left to right: y decreases when x increases. Between (1, 7) and (5, 3) the slope is −4 ÷ 4 = −1, so the line drops 1 unit for every unit across.
Why is the slope of a vertical line undefined?
A vertical line has the same x-value at every point, so the run is 0 and the formula would divide by zero. Division by zero has no value, so the slope is undefined, and the line is written x = constant.
What is the slope of a horizontal line?
It is 0. Both points share the same y-value, so the rise is 0, and 0 divided by any non-zero run is 0. For example, (2, 5) and (9, 5) give 0 ÷ 7 = 0.
How do I turn slope into an angle or a percent?
For percent grade, multiply the slope by 100, so m = 0.08 is 8%. For an angle, take the inverse tangent: arctan(0.08) ≈ 4.57°. A slope of 1 is 100% and 45°.
Was this guide helpful?
Continue reading
View all blogsDistance Formula: How Far Apart Are Two Points?
The distance between (1, 2) and (7, 10) is exactly 10 units. See where the formula comes from, how to use it and where it stops working.
5 min read
How to Calculate Percentage Change, Step by Step
Calculate percentage change with (new − old) ÷ old × 100. See a 15% rise and a 20% fall worked out, why points differ from percent, and what to do at zero.
6 min read
Mean, median and standard deviation, explained
Learn what mean, median and standard deviation tell you about a set of numbers, with one worked data set.
6 min read





