Math Solver Free

Slope Formula

The slope formula with worked examples: rise over run, the four kinds of slope, and the calculator to check yours.

The Slope Formula, Explained

The slope formula measures how steep a line is: m = (y₂ − y₁) / (x₂ − x₁). Take any two points on the line, (x₁, y₁) and (x₂, y₂); the numerator is the rise — how much y changes — and the denominator is the run — how much x changes. Slope is that ratio: for every unit of run, the line rises by m units (or falls, if m is negative). The same slope describes every pair of points on the line, which is why two points are enough.

Worked Example 1: (1, 2) and (5, 10)

Rise: 10 − 2 = 8. Run: 5 − 1 = 4. Slope: m = 8 / 4 = 2. Check by walking the line: from (1, 2), one step right and two up lands on (2, 4), then (3, 6) — on the same line through (5, 10). A slope of 2 means exactly that: twice as much rise as run.

Worked Example 2: Zero Slope and a Steep Slope

Between (2, 3) and (6, 3): rise 3 − 3 = 0, run 6 − 2 = 4, m = 0 / 4 = 0 — a horizontal line, no rise at all. Between (0, 1) and (3, 10): rise 9, run 3, m = 9 / 3 = 3 — steeper than Example 1. And if the two points share the same x, like (4, 1) and (4, 9), the run is 0 and the slope is undefined: a vertical line, which no function can describe.

Common Mistakes With the Slope Formula

  • Subtracting in mixed orders. y₂ − y₁ on top needs x₂ − x₁ underneath with the same point first in both: mixing the orders flips the slope's sign.
  • Inverting rise and run. Δx / Δy gives the reciprocal: for Example 1, 4 / 8 = 0.5 instead of 2.
  • Subtracting cross-coordinates. y₂ − x₁ is meaningless; each subtraction pairs the same coordinate of the two points.
  • Forgetting negatives count. From (1, 5) to (4, 2): rise 2 − 5 = −3, run 3, m = −1 — the line falls.

Worked Example 3: From Two Points to the Full Equation

Slope is usually the first step, not the destination. Take the line through (2, 3) and (6, 11). Slope first: m = (11 − 3) / (6 − 2) = 8 / 4 = 2. Then use point-slope form with either point — with (2, 3): y − 3 = 2(x − 2), which tidies to y = 2x − 1. Verify against the second point before trusting it: 2 × 6 − 1 = 11 ✓. Two facts about families of lines fall straight out of the slope: any line parallel to this one also has slope 2, and any line perpendicular to it has slope −1/2 — the negative reciprocal. That pair of rules answers a whole class of exam questions (“find the line through P parallel to…”) with no new machinery: copy the slope for parallel, flip and negate it for perpendicular, then run the same point-slope step.

Reading Slope From an Equation

When a line arrives as an equation rather than two points, solve for y first and read the slope off the x coefficient. For 3x + 2y = 12: move the x term over, 2y = −3x + 12, divide by 2, y = −(3/2)x + 6 — so the slope is −3/2 and the y-intercept is 6. The negative sign is information, not decoration: the line falls as x grows, dropping 3 units for every 2 it runs. This rearrangement is the same inverse-operations routine as solving any equation for a variable, and it is why slope-intercept form y = mx + b is the standard reporting format — both facts a graph-reader needs, slope and intercept, sit visible in the equation itself.

From Slope to the Equation, and the Calculator

Slope is the m in y = mx + b: with m = 2 and the point (1, 2), 2 = 2 × 1 + b gives b = 0, the line y = 2x. Check your point pairs in the slope calculator, and review the standard treatment in the graphing chapter of OpenStax Prealgebra. More formulas in the formulas library.

Frequently Asked Questions

What is the slope formula?

m = (y₂ − y₁) / (x₂ − x₁): the rise (change in y) divided by the run (change in x) between two points on the line. For (1, 2) and (5, 10): m = (10 − 2) / (5 − 1) = 8 / 4 = 2.

What does a slope of 0 mean?

The line is horizontal: y does not change as x moves, so the rise is 0 and m = 0 / run = 0. Do not confuse it with the undefined slope of a vertical line, where the run is 0 and the division is impossible.

Can slope be negative?

Yes: a negative slope means the line falls as you move right. From (1, 5) to (4, 2), the rise is 2 − 5 = −3 and the run is 3, so m = −1.

Does it matter which point is (x₁, y₁)?

No, as long as you are consistent: (y₂ − y₁) / (x₂ − x₁) and (y₁ − y₂) / (x₁ − x₂) give the same value, because both signs flip. The mistake is mixing: y₂ − y₁ on top with x₁ − x₂ underneath.

What is the slope of a vertical line?

Undefined. A vertical line has run zero — both points share the same x — so the slope formula divides by zero, which has no value. This is different from a horizontal line, whose slope is exactly 0 because its rise is zero. Vertical lines are written as x = a constant instead of y = mx + b.

How do parallel and perpendicular slopes relate?

Parallel lines have equal slopes. Perpendicular lines have slopes that are negative reciprocals: a line of slope 2 is perpendicular to a line of slope −1/2, because 2 × (−1/2) = −1. In general, perpendicular slopes always multiply to −1.

Related Tools & Guides