Slope and the Slope Formula
Slope tells you how steep a line is and which way it goes. It is the rise (how far the line goes up or down) divided by the run (how far it goes across). To find slope from two points, use the slope formula: m = \frac{y_2 - y_1}{x_2 - x_1}.
Before this lesson: You should know how to plot points on the coordinate plane and how to subtract negative numbers.
What Is Slope?
Picture yourself walking along a line from left to right. Slope compares two moves you make along the way:
- The rise is how far you go up or down.
- The run is how far you go to the right.
Slope is the rise divided by the run, and we use the letter m to stand for it.
Here is what a few different slopes tell you:
- A slope of 2 means: go 1 step right, then 2 steps up.
- A slope of \frac{1}{3} means: go 3 steps right, then 1 step up.
- A slope of -4 means: go 1 step right, then 4 steps down.
The bigger the number, the steeper the line. The sign (plus or minus) doesn’t change how steep the line is, only which way it goes.
The Slope Formula
When you know two points on a line, you can find the slope without drawing a graph. Call the points (x_1, y_1) and (x_2, y_2), where the small numbers just mean “first point” and “second point.”
m = \frac{\text{rise}}{\text{run}} = \frac{y_2 - y_1}{x_2 - x_1}In words: subtract the y-values, then subtract the x-values in the same order, and divide the first answer by the second.
It doesn’t matter which point you call the first point, as long as you keep the same order on the top and the bottom.
The Four Types of Slope
When you read a line from left to right, it will always do one of four things.
| Type of slope | What the line does (left to right) | Example |
|---|---|---|
| Positive | Goes up | m = 3 |
| Negative | Goes down | m = -\frac{1}{2} |
| Zero | Stays flat (horizontal) | y = 4 |
| Undefined | Goes straight up and down (vertical) | x = -2 |
Why is the slope of a vertical line undefined? Every point on a vertical line has the same x-value, so the run is 0. Since you can’t divide by 0, the slope does not exist, and we call it undefined.
Tip: Zero slope and undefined slope are easy to mix up. A flat line has no rise, so its slope is 0, but a vertical line has no run, so its slope is undefined. You’ll look at both more closely in the lesson on Horizontal and Vertical Lines.
Worked Examples
Example 1: Positive slope
Find the slope of the line through (2, 3) and (5, 9).
Step 1. Label the points: x_1 = 2, \quad y_1 = 3, \quad x_2 = 5, \quad y_2 = 9.
Step 2. Put the numbers into the slope formula.
m = \frac{9 - 3}{5 - 2} = \frac{6}{3} = 2Answer: m = 2. The line goes up 2 units for every 1 unit to the right.
Example 2: Negative slope
Find the slope of the line through (−1, 4) and (3, −2).
Step 1. Label the points: x_1 = -1, \quad y_1 = 4, \quad x_2 = 3, \quad y_2 = -2.
Step 2. Put the numbers into the formula and watch the signs, because subtracting −1 is the same as adding 1.
m = \frac{-2 - 4}{3 - (-1)} = \frac{-6}{4} = -\frac{3}{2}Answer: m = -\frac{3}{2}. The line goes down 3 units for every 2 units to the right.
Example 3: Slope from a graph
Find the slope of the line in the graph below.
Step 1. Pick two points where the line crosses the grid corners exactly, such as (2, 4) and (5, 2).
Step 2. Start at the left point, (2, 4), and count down until you reach the level of the other point. You go down 2, so the rise is -2.
Step 3. Next, count to the right until you reach (5, 2). You go right 3, so the run is 3.
Step 4. Divide the rise by the run: m = \frac{-2}{3} = -\frac{2}{3}.
Answer: m = -\frac{2}{3}. Check: the line goes down from left to right, so a negative slope makes sense.
Example 4: Undefined slope
Find the slope of the line through (3, −1) and (3, 5).
m = \frac{5 - (-1)}{3 - 3} = \frac{6}{0}Answer: The slope is undefined, because you can’t divide by 0. Both points have x = 3, so this is the vertical line x = 3.
Example 5: Word problem
A hiking trail starts 200 feet above sea level, and after 4 miles it is 1,000 feet above sea level. What is the slope of the trail? What does it mean?
Step 1. Write the facts as two points in the form (miles, feet): (0, 200) and (4, 1000).
Step 2. Use the slope formula.
m = \frac{1000 - 200}{4 - 0} = \frac{800}{4} = 200Answer: The slope is 200 feet per mile. The trail climbs 200 feet for every mile you walk.
Common Mistakes
| Mistake | What it looks like | How to fix it |
|---|---|---|
| Putting x on top | \frac{5 - 2}{9 - 3} = \frac{1}{2} | The y-values always go on top. Think “rise over run.” |
| Mixing up the order | \frac{9 - 3}{2 - 5} = -2 | Start with the same point on the top and the bottom. |
| Losing a minus sign | 3 - (-1) = 2 | Subtracting a negative means adding: 3 + 1 = 4. |
| Calling a vertical line “zero slope” | x = 3 has m = 0 | Vertical lines have undefined slope. Flat lines have slope 0. |
| Not simplifying | m = \frac{6}{4} | Reduce the fraction: m = \frac{3}{2}. |
Quick check: Before you finish, look at your line. If it goes up from left to right, your slope should be positive, and if it goes down, your slope should be negative.
Other Ways to Find Slope
From an equation
If the equation looks like y = mx + b, the slope is the number in front of x.
- y = 3x - 5 → the slope is 3.
- y = -2x + 4 → the slope is -2.
- y = \frac{1}{4}x + 1 → the slope is \frac{1}{4}.
If the equation looks different, get y by itself first, as shown here for 2x + 3y = 6.
\begin{aligned}
2x + 3y &= 6 \\
3y &= -2x + 6 \\
y &= -\tfrac{2}{3}x + 2
\end{aligned}So the slope is -\frac{2}{3}, and you’ll practice this skill in the lesson on Slope-Intercept Form.
From a table
Pick any two rows of the table and treat them as points.
| x | y |
|---|---|
| 1 | 4 |
| 3 | 10 |
| 5 | 16 |
Using (1, 4) and (3, 10): m = \frac{10 - 4}{3 - 1} = \frac{6}{2} = 3.
If you try (3, 10) and (5, 16) instead, you get \frac{6}{2} = 3 again. When every pair of rows gives the same slope, the table describes a line, which you can learn more about in Two-Variable Linear Equations.
Practice Problems
Find the slope of each line. Simplify any fractions, and write “undefined” if the slope does not exist.
- (1, 2) and (4, 8)
- (0, 5) and (2, −1)
- (−3, −2) and (1, 0)
- (−4, 7) and (6, 7)
- (−2, 1) and (−2, −6)
- (−5, 3) and (5, −1)
- y = -5x + 9
- 4x - 2y = 10
- A water tank holds 50 gallons. After 6 minutes of draining, it holds 20 gallons. What is the slope? What does it mean?
10. The table below shows points on a line. Find the slope.
| x | y |
|---|---|
| 0 | 7 |
| 2 | 4 |
| 4 | 1 |
Show answers
- m = \frac{8 - 2}{4 - 1} = \frac{6}{3} = 2
- m = \frac{-1 - 5}{2 - 0} = \frac{-6}{2} = -3
- m = \frac{0 - (-2)}{1 - (-3)} = \frac{2}{4} = \frac{1}{2}
- m = \frac{7 - 7}{6 - (-4)} = \frac{0}{10} = 0. This is a horizontal line.
- m = \frac{-6 - 1}{-2 - (-2)} = \frac{-7}{0}, so the slope is undefined. This is the vertical line x = -2.
- m = \frac{-1 - 3}{5 - (-5)} = \frac{-4}{10} = -\frac{2}{5}
- The equation is already in the form y = mx + b, so m = -5.
- Get y by itself: -2y = -4x + 10, so y = 2x - 5. The slope is 2.
- The points are (0, 50) and (6, 20): m = \frac{20 - 50}{6 - 0} = \frac{-30}{6} = -5. The slope is −5 gallons per minute, so the tank loses 5 gallons every minute.
- Using (0, 7) and (2, 4): m = \frac{4 - 7}{2 - 0} = -\frac{3}{2}. The pair (2, 4) and (4, 1) gives the same answer.
Slope FAQ
What is the slope formula?
The slope formula is m = \frac{y_2 - y_1}{x_2 - x_1}. It finds the slope of a line from any two points on the line.
What does “rise over run” mean?
Rise is how far a line goes up or down, and run is how far it goes to the right. “Rise over run” means you divide the rise by the run, and the answer is the slope.
Can a slope be a fraction or a negative number?
Yes. A slope of \frac{2}{3} means the line goes up 2 for every 3 steps to the right. A negative slope means the line goes down from left to right.
Is the slope of a horizontal line 0 or undefined?
A horizontal (flat) line has a slope of 0, while a vertical line has an undefined slope.
Summary
- Slope is the rise divided by the run.
- The slope formula is m = \frac{y_2 - y_1}{x_2 - x_1}.
- A line that goes up from left to right has a positive slope. Down is negative, flat is zero, and vertical is undefined.
- In y = mx + b, the slope is m.
- Keep the same order on the top and the bottom, and watch your minus signs.
Previous lesson: X-Intercepts and Y-Intercepts
Next lesson: Horizontal and Vertical Lines
Back to the Algebra 1 Index
