Part 6 of 10 · LinesSee the whole course

Slope-intercept form: y = mx + b, explained

Short answer

y = mx + b is the equation of a line. m is the slope (how steep it is) and b is the y-intercept (where the line crosses the y-axis, its height when x = 0). Read off m and b and you know the whole line.

Some books and the Pip app write y = ax + b instead. It is exactly the same thing, with the letter a in place of m.

Two numbers describe any line

A straight line changes by the same amount every step. So you only need two facts: how fast it changes (the slope, m) and where it starts (the y-intercept, b).

A gym costs 20 to join and 5 per visit. After x visits you have paid y = 5x + 20. The slope is 5 (each visit adds 5), and b is 20 (where you start, before any visit).

Read m and b from an equation

In y = mx + b, the number multiplying x is the slope, and the number added at the end is where the line starts.

y = 2x + 3 → m = 2, b = 3, starts at (0, 3)
y = −3x + 5 → m = −3, b = 5
y = x − 4 → m = 1, b = −4
y = 7 → m = 0, b = 7

Two things to watch. When x stands alone, the slope is 1 (and −x means −1). And the sign belongs to the number after it: in y = x − 4, b is −4.

Try it. Slide m and b, and watch the line pivot and slide.

y = 2x + 3
The line starts at height 3, then goes up 2 for every 1 step across.

Write the equation from m and b

Put the slope in front of x and the starting height at the end. A line with slope 4 that crosses the y-axis at −2 is:

y = 4x + (−2) → y = 4x − 2

When b is negative, write it as a subtraction.

What if the equation is not in this form yet?

Sometimes the equation comes in a different shape. Get y alone on the left first, then read m and b.

2y = 4x + 6
y = 2x + 3 (divide everything by 2)

3x + y = 5
y = −3x + 5 (subtract 3x from both sides)

Divide every term, not just one. In the first example, 4x + 6 divided by 2 is 2x + 3.

Watch it explained in under a minute

The same idea, narrated step by step. Square version for sharing: download the 1:1 video.

The five mistakes to avoid

Try it yourself

Tap a question to see the answer.

1. What are the slope and the y-intercept of y = −3x + 5?

The slope is −3 and the y-intercept is 5.

2. Write the equation of the line with slope 4 that crosses the y-axis at −2.

y = 4x − 2.

3. Write 3x + y = 5 in the form y = mx + b.

Subtract 3x from both sides: y = −3x + 5.

Where slope-intercept form fits in

This is the form you will use most. If slope is new, start with what slope is and how to find it from two points. Next in this course: how to graph a line from its equation.

Quick answers

Questions about this topic

What does y = mx + b mean?

It is the equation of a line. m is the slope, how much the line goes up for every 1 step across, and b is the y-intercept, the height where the line crosses the y-axis.

What is the y-intercept?

The y-intercept is the point where a line crosses the y-axis. It happens at x = 0, so the point is (0, b), and b is the number added at the end of y = mx + b.

Why is it called slope-intercept form?

Because the two numbers in the equation are the slope (m) and the y-intercept (b). You can read both straight from the equation.

Is y = mx + b the same as y = ax + b?

Yes. Different books use different letters. The number that multiplies x is the slope, and the number added at the end is the y-intercept, whichever letters are used.

Keep going

Learn it by playing

Pip: Math Adventure is a math game for iPhone where functions, lines, equations and calculus are puzzles you solve by playing. It is coming soon to the App Store.

Join the list and we will tell you the day Pip is out.