How to Find the Slope From a Graph, a Table or an Equation
Find the slope from a graph by counting rise over run between two points. Also from a table, from y = mx + b and standard form, with worked examples.
By Muhammad Awais, Founder and editor-in-chiefPublished
To find the slope from a graph, pick two points where the line crosses the grid, count how far you go up or down (the rise), count how far you go right (the run), and divide: slope = rise ÷ run. If the line goes uphill from left to right the slope is positive; downhill, it’s negative.
If you already have two points, the slope calculator gives the slope as a fraction, plus the angle, the distance and the line’s equation, with every step shown.
From a graph
- Pick two points that sit exactly on grid corners. Here the line passes through (0, 1) and (2, 5). Avoid points you have to guess, like “about 3.4”.
- Count the run. From the left point, count squares to the right until you’re under the second point: 2.
- Count the rise. Count squares up to the second point: 4. If you have to count down, the rise is negative.
- Divide. Slope = 4 ÷ 2 = 2. The line climbs 2 units for every 1 unit to the right.
A downhill example: a line through (0, 4) and (4, 1). The run is 4 to the right, and you go down 3, so the rise is −3. The slope is −3 ÷ 4 = −3/4.
Check the axis scale. If the x-axis counts in 2s or the y-axis in 10s, count units, not squares. A line that rises 2 squares over 1 square on a y-axis marked 0, 10, 20 has a slope of 20 ÷ 1 = 20, not 2.
Special lines
| Line on the graph | Rise | Run | Slope |
|---|---|---|---|
| Uphill, left to right | positive | positive | positive |
| Downhill, left to right | negative | positive | negative |
| Flat (horizontal) | 0 | any | 0 |
| Straight up (vertical) | any | 0 | undefined (you can’t divide by 0) |
From a table
Take any two rows and divide the change in y by the change in x.
| x | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| y | 5 | 8 | 11 | 14 |
From the first two rows: (8 − 5) ÷ (2 − 1) = 3 ÷ 1 = 3. Check with two other rows: (14 − 5) ÷ (4 − 1) = 9 ÷ 3 = 3. Same answer, so the points really are on one straight line.
If the answers differ, the table isn’t a straight line and has no single slope. For x = 0, 1, 2 and y = 0, 1, 4, the first step gives 1 and the second gives 3, so it’s a curve.
From an equation
| Form | Example | Slope |
|---|---|---|
| Slope-intercept: y = mx + b | y = −2x + 7 | the number in front of x: −2 |
| Standard: Ax + By = C | 3x + 4y = 12 | −A ÷ B = −3/4 |
| Point-slope: y − y₁ = m(x − x₁) | y − 2 = 5(x + 1) | 5 |
If the equation is in another order, rearrange it to y = mx + b first. For 2y − 6x = 10, add 6x to both sides (2y = 6x + 10), then divide by 2: y = 3x + 5. The slope is 3.
From two points
When you’re given the points instead of a graph, use the formula directly. For (2, 3) and (6, 11):
It doesn’t matter which point you call the first, as long as you use the same order on the top and the bottom: (3 − 11) ÷ (2 − 6) = −8 ÷ −4 = 2. The slope calculator also shows the line’s equation, y = 2x − 1, and the distance between the points. That distance comes from the Pythagorean theorem, which the Pythagorean theorem calculator works out step by step.
Parallel and perpendicular lines
- Parallel lines have the same slope. Any line parallel to y = 2x − 1 has a slope of 2.
- Perpendicular lines have slopes that are negative reciprocals: flip the fraction and change the sign. A line perpendicular to a slope of 2 has a slope of −1/2. A line perpendicular to −3/4 has a slope of 4/3.
Slope in real life
- Road grade: a grade is the slope as a percentage. A road that rises 8 m over 100 m has a slope of 0.08, an 8% grade.
- Roof pitch: a 6/12 pitch rises 6 inches for every 12 inches across, a slope of 0.5.
- Wheelchair ramps: the US ADA Standards allow a running slope of at most 1:12, which is 1 ÷ 12 ≈ 0.083, or about 8.3%.
The slope calculator converts a slope into an angle and a percent grade, and simplifies messy fractions. For other fraction work, the fraction calculator simplifies and combines fractions.
Common mistakes
- Run over rise. It’s rise ÷ run, y over x. Run ÷ rise gives the reciprocal (1/2 instead of 2).
- Mixed-up order. (y₂ − y₁) on top needs (x₂ − x₁) on the bottom, in the same order.
- Wrong sign. Look at the line before you calculate: downhill means negative. If your answer disagrees with the picture, recheck the rise.
- Counting squares on a scaled axis. Count the units shown on the axis.
FAQ
How do you find the slope of a line on a graph?
Pick two points on the line where it crosses grid corners, count the rise (vertical change) and the run (horizontal change) between them, and divide the rise by the run.
What is the slope of a horizontal line?
0, because a horizontal line has no rise. A vertical line has an undefined slope, because its run is 0.
How do you find the slope from an equation?
Rearrange it into y = mx + b. The number multiplying x, m, is the slope. For standard form Ax + By = C, the slope is −A ÷ B.
How do you find the slope from a table?
Divide the change in y by the change in x between any two rows. If every pair of rows gives the same answer, that’s the slope.