How to Find Slope: Formula, From a Graph and From an Equation
The slope of a line is m = (y₂ − y₁) ⁄ (x₂ − x₁) — the change in y divided by the change in x between any two points on it, often called rise over run. A positive slope rises to the right, a negative slope falls, a horizontal line has slope 0, and a vertical line has an undefined slope.
Check it yourself: every example here can be loaded into the Slope Intercept Form Calculator.
Open the Slope Intercept Form CalculatorThe slope formula
For two points (x₁, y₁) and (x₂, y₂) on a line,
The top is the vertical change (rise), the bottom is the horizontal change (run). Because a line is straight, you get the same slope from any two points on it.
Method 1: from two points
Find the slope through (−1, 4) and (3, −2).
- Label: x₁ = −1, y₁ = 4, x₂ = 3, y₂ = −2.
- Rise: y₂ − y₁ = −2 − 4 = −6.
- Run: x₂ − x₁ = 3 − (−1) = 4.
- Slope: m = −6 ⁄ 4 = −3⁄2.
The negative sign tells you the line falls from left to right; the size 1.5 says it drops 1.5 units for every 1 unit across.
- Slope through (−1, 4) and (3, −2) — opens the Slope Intercept Form Calculator
Method 2: from a graph
- Choose two points where the line passes exactly through grid corners.
- Count the run from left to right (always positive in this direction).
- Count the rise: up is positive, down is negative.
- Divide rise by run and simplify.
Choosing points far apart reduces reading errors. If the grid is not one unit per square, check the axis labels before counting.
Text description of this figure
Three panels: a positive-slope line rising to the right, a negative-slope line falling to the right, and a horizontal line with slope 0 next to a vertical line with undefined slope.
- Positive slope: the line goes up as x increases.
- Negative slope: the line goes down as x increases.
- Horizontal: rise is 0, so m = 0. Vertical: run is 0, so m is undefined.
Method 3: from an equation
| Equation form | Slope |
|---|---|
| y = mx + b | m (the coefficient of x) |
| y − y₁ = m(x − x₁) | m |
| Ax + By = C | −A ⁄ B |
| y = c (horizontal) | 0 |
| x = c (vertical) | undefined |
For 4x − 2y = 6: m = −4 ⁄ (−2) = 2. Check by solving for y: −2y = −4x + 6, so y = 2x − 3 ✓.
- Slope of 4x − 2y = 6 — opens the Slope Intercept Form Calculator
Zero and undefined slopes
- Through (1, 3) and (5, 3): m = (3 − 3) ⁄ (5 − 1) = 0 ⁄ 4 = 0. The line is horizontal, y = 3.
- Through (2, 1) and (2, 6): m = (6 − 1) ⁄ (2 − 2) = 5 ⁄ 0, which is undefined. The line is vertical, x = 2.
A good memory aid: horizontal lines are flat like a floor (you can walk on them — zero effort, slope 0); vertical lines are walls you cannot walk up (undefined). More in horizontal and vertical lines.
- Slope of a vertical line through (2, 1) and (2, 6) — opens the Slope Intercept Form Calculator
Slope as a rate of change
Slope carries units: (units of y) per (unit of x). Some examples:
- A road rising 12 m over 200 m of horizontal distance has slope 12 ⁄ 200 = 0.06, a 6% grade.
- Savings growing from $150 to $390 over 6 months: m = 240 ⁄ 6 = $40 per month.
- Temperature falling from 18 °C to 6 °C over 4 hours: m = −12 ⁄ 4 = −3 °C per hour.
Common mistakes
- Run over rise. Δx ⁄ Δy gives the reciprocal. Always put y on top.
- Mixed order. (y₂ − y₁) ⁄ (x₁ − x₂) flips the sign.
- Calling 0 ⁄ 4 undefined. Zero divided by a number is 0. Only a zero denominator is undefined.
- Ignoring axis scales when reading a slope off a graph.
Once you have the slope, write the line with slope-intercept form or point-slope form.
Questions
Does it matter which point is first?
No, as long as you use the same order on top and bottom. (y₂ − y₁)/(x₂ − x₁) and (y₁ − y₂)/(x₁ − x₂) are equal.
Why is the slope of a vertical line undefined?
The run is zero, and division by zero has no value. A vertical line has no single rate of change.
What does slope mean in a word problem?
It is a rate: units of y per unit of x. A slope of 60 on a distance–time graph means 60 miles per hour.
Graph your own example with the Slope Intercept Form Calculator — free, in your browser.
Try it nowSources and further reading
- OpenStax, Elementary Algebra 2e — 4.4 Understand Slope of a Line
- OpenStax, College Algebra 2e — 4.1 Linear Functions
Worked examples and figures were produced and checked with the Graphing Calculator Lab engine. See the editorial policy.