Quick answer: To find the slope of a line, pick two points on it, (x₁, y₁) and (x₂, y₂), and divide the change in y by the change in x: m = (y₂ − y₁) ÷ (x₂ − x₁). This is "rise over run". A positive slope rises left to right, a negative slope falls, a horizontal line has slope 0 and a vertical line has an undefined slope.
Slope is one of the first big ideas in US Algebra 1 and Grade 8 math, UK GCSE maths (where it is called the gradient) and Canadian Grade 9 and 10 math. It also turns up on the SAT, ACT, GED and many entrance tests. This guide shows the four ways you will be asked to find it: from two points, from a graph, from a table and from an equation. When you finish, test yourself with our 20-question slope quiz with answers.
Key takeaways
- Slope formula: m = (y₂ − y₁) / (x₂ − x₁) = rise / run.
- Subtract in the same order on top and bottom, or the sign will be wrong.
- In y = mx + b, the number in front of x (m) is the slope.
- In a table, slope = change in y ÷ change in x between any two rows.
- Slope 0 = horizontal line; undefined slope = vertical line.
What is the slope of a line?
The slope of a line measures how steep it is and which way it goes. It tells you how much y changes when x increases by 1. A slope of 3 means the line goes up 3 units for every 1 unit to the right; a slope of −½ means it goes down half a unit for every 1 unit to the right. Mathematicians usually write slope with the letter m. For a fuller history and definition, see the Wikipedia article on slope.
The slope formula (rise over run)
m = (y₂ − y₁) / (x₂ − x₁)
Rise is the vertical change (y₂ − y₁). Run is the horizontal change (x₂ − x₁). Dividing rise by run gives the slope. If you want to check your answer, our sister site has a free slope calculator that shows each step.
Method 1: How to find slope from two points
- Label the points (x₁, y₁) and (x₂, y₂).
- Subtract the y-values: y₂ − y₁.
- Subtract the x-values in the same order: x₂ − x₁.
- Divide and simplify the fraction.
Example 1: (2, 3) and (6, 11)
m = (11 − 3) / (6 − 2) = 8 / 4 = 2. The line rises 2 units for every 1 unit to the right.
Example 2: (−1, 4) and (3, −4)
m = (−4 − 4) / (3 − (−1)) = −8 / 4 = −2. Watch the double negative: 3 − (−1) = 4.
Example 3: (−3, −2) and (5, 2)
m = (2 − (−2)) / (5 − (−3)) = 4 / 8 = ½. Need help simplifying fractions? Use the fraction calculator on PakMath.
Method 2: How to find slope from a graph
- Find two points where the line crosses grid corners exactly (lattice points).
- From the left point, count how many units you move up (+) or down (−). That is the rise.
- Count how many units you move right to reach the second point. That is the run.
- Slope = rise ÷ run.
Example 4: A line passes through (0, 1) and (3, 7). From (0, 1) you go up 6 and right 3, so m = 6 / 3 = 2.
Method 3: How to find slope from a table
A table of values is just a list of points. Choose any two rows and use the slope formula. If the table shows a straight line, every pair of rows gives the same answer, which is a good way to check your work.
Example 5:
| x | 0 | 2 | 4 | 6 |
|---|---|---|---|---|
| y | 5 | 11 | 17 | 23 |
x goes up by 2 each time and y goes up by 6, so m = 6 / 2 = 3.
Example 6:
| x | 1 | 3 | 5 |
|---|---|---|---|
| y | 10 | 6 | 2 |
x increases by 2 while y decreases by 4, so m = −4 / 2 = −2. In real-world tables this is called the rate of change, for example dollars per hour or miles per gallon.
Method 4: How to find slope from an equation
Rearrange the equation into slope-intercept form, y = mx + b. The coefficient of x is the slope and b is the y-intercept.
- Example 7: y = 5x − 7 → slope 5.
- Example 8: 2x + 3y = 12 → 3y = −2x + 12 → y = −⅔x + 4 → slope −⅔.
- Example 9: 4x − 2y = 8 → −2y = −4x + 8 → y = 2x − 4 → slope 2.
Shortcut for standard form Ax + By = C: slope = −A / B. For 2x + 3y = 12, m = −2/3. ✔
The four types of slope
| Type | What the line does | Example |
|---|---|---|
| Positive | Rises from left to right | y = 2x + 1 |
| Negative | Falls from left to right | y = −3x + 4 |
| Zero | Horizontal (flat) | y = 5 |
| Undefined | Vertical | x = −2 |
Students mix up the last two all the time. We explain why in Zero Slope vs Undefined Slope: Horizontal and Vertical Lines Explained.
Slope in real life: ramps, roads and roofs
- Wheelchair ramps: the US ADA Standards limit most ramps to a slope of 1:12 (1 unit of rise per 12 units of run), which is about 0.083 or 8.3%.
- Road grade: a 6% grade means the road rises 6 m for every 100 m travelled horizontally, a slope of 0.06. Turn decimals into percentages with the percentage calculator.
- Stairs and roofs: builders use rise and run for every step and roof pitch. Try the stair calculator or roofing calculator.
- Slope to angle: the angle a line makes with the x-axis is θ = tan⁻¹(m). A slope of 1 is 45°; a slope of 2 is about 63.4°. Use the scientific calculator for tan⁻¹ and the angle converter to switch between degrees and radians. Brush up on tan with our 7 fundamental trigonometric identities.
5 common slope mistakes (and how to avoid them)
- Run over rise. Always put the y-change on top.
- Mixed order. If you start with y₂ on top, start with x₂ on the bottom.
- Sign slips with negatives. Write brackets: 3 − (−1), not 3 − −1.
- Reading the slope from standard form. In 2x + 3y = 12 the slope is not 2; solve for y first.
- Calling a vertical line "zero slope". Vertical = undefined; horizontal = zero.
Practice questions with answers
Try each one, then tap to reveal the answer.
1. Find the slope through (1, 2) and (4, 8).
m = (8 − 2)/(4 − 1) = 6/3 = 2.
2. Find the slope through (0, −3) and (5, −3).
m = 0/5 = 0 (horizontal line).
3. Find the slope through (2, 1) and (2, 9).
Run = 0, so the slope is undefined (vertical line x = 2).
4. What is the slope of 3x + y = 7?
y = −3x + 7, so m = −3.
5. Find the slope from the table x: 2, 4, 6 and y: 7, 4, 1.
Δy = −3, Δx = 2, so m = −3/2.
Ready for more? Take the full slope quiz (20 MCQs) or the parallel and perpendicular lines quiz.
Printable tip for teachers and parents: copy the practice questions into a Word file and turn it into a worksheet with Word to PDF, or snap photos of hand-worked answers and combine them with JPG to PDF. Both tools on PDFWisely are free.
Frequently asked questions
What is the formula for slope?
m = (y₂ − y₁) / (x₂ − x₁): the change in y divided by the change in x between two points on the line.
Is slope the same as gradient?
Yes. UK and Australian textbooks say "gradient"; US and Canadian textbooks usually say "slope". The formula is identical.
How do you find slope from a table?
Pick two rows, subtract the y-values, subtract the x-values in the same order and divide. For a linear table, every pair of rows gives the same slope.
Can a slope be a fraction or a decimal?
Yes. Slopes such as ½, −⅔ or 0.75 are common. Leave answers as simplified fractions unless the question asks for a decimal.
What does a slope of 0 mean?
The line is horizontal: y does not change as x changes.
How do I find the distance or midpoint between the same two points?
Use the distance formula or midpoint formula, or try the free distance calculator and midpoint calculator.
Keep learning on GK19
About the author: Dr. Muhammad Amjad Khadim holds a PhD in Mathematics from COMSATS University Islamabad and founded PakMath, Adzita and PDFWisely. Google Scholar profile.