Slope Formula

The Slope Formula measures a line's steepness by dividing the vertical change between two points by their horizontal change.

m=y2y1x2x1m = \frac{y_2 - y_1}{x_2 - x_1}

Solve a problem with Slope Formula

Type the problem. The solver will use Slope Formula where Slope Formula is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Slope Formula takes
mm
x1x_1
y1y_1
x2x_2
y2y_2
Slope Formula
SymbolMeaning
mmThe slope, a number describing how steep the line is; positive means rising left-to-right, negative means falling, zero is horizontal, and undefined means vertical.
x1x_1The x-coordinate of the first point, which is the horizontal position; reversing which point you call '1' will flip the sign of the slope.
y1y_1The y-coordinate of the first point, which is the vertical position; it must be subtracted in the same order as its x-coordinate to avoid sign errors.
x2x_2The x-coordinate of the second point, which is the horizontal position; it must be different from x1x_1 or the slope is undefined.
y2y_2The y-coordinate of the second point, which is the vertical position and appears in the numerator of the slope formula.

When to use it

Use the Slope Formula when you have two points on a line and need to find its steepness or rate of change.

Level

Usually taught in: Algebra I · Appears on: SAT, ACT

Worked examples

1. Find slope with two simple points

Problem

Find the slope of the line through the points (1,2)(1, 2) and (4,8)(4, 8).
  1. m=8241m = \frac{8 - 2}{4 - 1}

    We substitute the y-coordinates and x-coordinates from the two points into the Slope Formula.

  2. m=63m = \frac{6}{3}

    We simplify the numerator: 82=68 - 2 = 6, and the denominator: 41=34 - 1 = 3.

  3. m=2m = 2

    We divide the fraction to get the slope.

Answer: m=2m = 2

The slope is 2, meaning the line rises 2 units for every 1 unit it moves right, indicating a line that goes uphill from left to right.

2. Find slope with negative coordinates

Problem

Find the slope of the line through (2,5)(2, -5) and (1,4)(-1, 4).
  1. m=4(5)12m = \frac{4 - (-5)}{-1 - 2}

    We substitute into the formula, being careful to keep the negative signs with their coordinates.

  2. m=93m = \frac{9}{-3}

    We simplify: 4(5)=4+5=94 - (-5) = 4 + 5 = 9, and 12=3-1 - 2 = -3.

  3. m=3m = -3

    We divide, remembering that a positive divided by a negative gives a negative result.

Answer: m=3m = -3

The negative slope of -3 means the line falls as you move left to right; for each unit right, the line drops 3 units down. Negative slopes indicate downhill lines.

3. Find rate of change from a bake sale scenario

Problem

At a school bake sale, revenue is $15\$15 after selling 10 cookies and $60\$60 after selling 40 cookies. What is the slope (rate of change) in dollars per cookie?
  1. m=60154010m = \frac{60 - 15}{40 - 10}

    We substitute the revenue values (y-coordinates) and cookie counts (x-coordinates) into the Slope Formula.

  2. m=4530m = \frac{45}{30}

    We subtract: 6015=4560 - 15 = 45 dollars in the numerator, and 4010=3040 - 10 = 30 cookies in the denominator.

  3. m=32m = \frac{3}{2}

    We simplify the fraction by dividing both parts by 15.

  4. m=1.5m = 1.5

    We convert the fraction to a decimal to show the rate clearly.

Answer: m=32 or 1.5m = \frac{3}{2} \text{ or } 1.5

The slope is $1.50 per cookie, meaning each cookie sold generates $1.50 in revenue. This shows why slope matters beyond geometry—it measures how quantities change together in real situations.

Common mistakes

Where Slope Formula usually goes wrong
Answer came out wrong
Writing m=x2x1y2y1m = \frac{x_2 - x_1}{y_2 - y_1} (flipping the numerator and denominator).
Remember the formula is m=y2y1x2x1m = \frac{y_2 - y_1}{x_2 - x_1}: y (rise) goes on top, x (run) goes on the bottom.
Subtracting in the wrong order in only one part, like writing m=y1y2x2x1m = \frac{y_1 - y_2}{x_2 - x_1}.
Subtract consistently in both parts: either second point minus first in both, or first minus second in both.
Computing slope for two points with the same x-coordinate, like (3,1)(3, 1) and (3,5)(3, 5), and calling the slope zero.
If x2=x1x_2 = x_1, state that the slope is undefined; this is a vertical line, different from a horizontal line which has slope zero.
The mistakeWhy it is wrongThe fix
Writing m=x2x1y2y1m = \frac{x_2 - x_1}{y_2 - y_1} (flipping the numerator and denominator).This gives the reciprocal of the slope, which is backward; you are measuring run over rise instead of rise over run.Remember the formula is m=y2y1x2x1m = \frac{y_2 - y_1}{x_2 - x_1}: y (rise) goes on top, x (run) goes on the bottom.
Subtracting in the wrong order in only one part, like writing m=y1y2x2x1m = \frac{y_1 - y_2}{x_2 - x_1}.If you subtract backwards in only the numerator or only the denominator, you flip the sign of the slope and get the opposite answer.Subtract consistently in both parts: either second point minus first in both, or first minus second in both.
Computing slope for two points with the same x-coordinate, like (3,1)(3, 1) and (3,5)(3, 5), and calling the slope zero.Division by zero is undefined, not zero; a vertical line has undefined slope because there is no horizontal change and steepness is infinitely steep.If x2=x1x_2 = x_1, state that the slope is undefined; this is a vertical line, different from a horizontal line which has slope zero.

Tips and when to use something else

  • If you get a fraction for the slope, leave it as a fraction rather than rounding to a decimal unless the problem asks you to.
  • Negative slope means the line falls left-to-right; positive slope means it rises; a slope of zero means the line is horizontal.
  • The Slope Formula is the foundation for Slope-Intercept Form (y=mx+by = mx + b), which you will use to write equations of lines.
  • If the two points are on a vertical line (same x-coordinate), use the Equation of a Vertical Line (x=cx = c) instead, since slope is undefined.

Frequently asked questions

Can slope be a fraction?
Yes, slope is often a fraction and you should keep it that way. A slope of 23\frac{2}{3} means for every 3 units right, the line goes up 2 units. Decimals hide this ratio.
What is the difference between slope and steepness?
Slope is the mathematical measure of steepness; a larger absolute value (like 5) means steeper than a smaller one (like 0.5). Slope also includes sign to show direction.
Does the order of the two points matter?
No, the final slope value is the same no matter which point you label as (1) or (2). If you reverse them, the numerator and denominator both flip, so the sign stays correct.
What does an undefined slope mean in real life?
An undefined slope represents a vertical line, like the wall of a building. It is undefined because there is no horizontal change, so you cannot measure steepness as a ratio.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18