Skip to content

Slope Formula

The slope (rate of change) of the line through two points.

Variables

(x₁, y₁), (x₂, y₂)
Two points on the line
m
Slope

Explanation

Slope is rise over run: the change in y divided by the change in x. Parallel lines have equal slopes; perpendicular lines have slopes whose product is −1.

Example

Through and : .

How to use it

  1. Label the points and .
  2. Subtract the -values on top and the -values on the bottom, in the same order.
  3. Simplify the fraction.

Another worked example

Through and :

The line falls 2 units for every 1 unit to the right.

From slope to equation

With through : , so .

Reading the result

  • Positive: rising. Negative: falling.
  • Zero: horizontal line ().
  • Undefined: vertical line (, so you'd divide by 0).
  • Parallel lines have equal slopes, and perpendicular slopes multiply to .

Common mistakes

  • Swapping the order on the bottom only, which flips the sign.
  • Putting on top.
  • Sign errors when subtracting negatives.

Slope as a rate

If a car is at 40 km at 1 pm and 160 km at 3 pm, the slope is its average speed in km/h. Slope always means "change in output per unit of input".

Where it's used

  • Roads and ramps: a road's grade is its slope as a percentage. Wheelchair ramps are often limited to a slope of .
  • Roofing: roof pitch is rise over run, like 6 inches per 12 inches.
  • Data: the slope of a trend line gives the rate of change, such as sales per month.
  • Physics: the slope of a distance-time graph is speed.

Key takeaways

  • Slope is change in divided by change in .
  • Subtract in the same order on top and bottom.
  • Zero slope is horizontal; undefined slope is vertical.

Try it: Slope Calculator

Find the slope, equation of the line, distance and midpoint between two points.

Open calculator

Practice problems

Try each one first, then open the answer to check your work.

  1. 1.Find the slope through and .

    Show answer

    .

  2. 2.Find the slope through and .

    Show answer

    .

  3. 3.Find the slope through and .

    Show answer

    Undefined. The line is vertical.

  4. 4.A line has slope . What's the slope of a perpendicular line?

    Show answer

    .

  5. 5.A road rises 30 m over 600 m horizontally. What's its grade?

    Show answer

    , a 5% grade.

Key terms

Slope
The rate of change of a line, rise over run.
Rise
The vertical change, .
Run
The horizontal change, .
Slope-intercept form
, where is the y-intercept.
Rate of change
How fast one quantity changes compared with another.

Frequently asked questions

What is point-slope form?

y − y₁ = m(x − x₁).

What does the slope tell me?

How much changes for each 1-unit increase in . A slope of 3 means the line goes up 3 for every step right. Negative slopes go down from left to right.

What's the slope of a horizontal line?

Zero, because doesn't change. A vertical line has an undefined slope because doesn't change, giving division by zero.

How do slopes show parallel and perpendicular lines?

Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to , like 2 and .

How do I get the equation of the line?

Use point-slope form with either point, then rearrange to if needed.

Can I pick any two points on a line?

Yes. A straight line has the same slope everywhere, so any two distinct points give the same answer.

What's the slope of a curve?

It changes from point to point. The slope between two points is an average rate of change; the slope at one point is the derivative.

How do I find the slope from an equation?

Rearrange into and read . For , , so the slope is .

What's the slope of a line at a $45°$ angle?

1. In general, the slope equals , where is the angle the line makes with the positive x-axis.

What does a slope of $\frac{1}{3}$ mean?

For every 3 units right, the line goes up 1. It's a gentle upward line.

Related formulas

More algebra formulas