Skip to main content
Math MaxBeta

Published November 6, 2026

Slope-intercept form (y = mx + b) explained step by step

Slope-intercept form writes a line as y = mx + b, where m is the slope and b is the y-intercept, the spot where it crosses the y-axis.

Once an equation is in this form, you can read the slope and the starting point straight off it and sketch the line in seconds. Below you'll find how to read it, how to build it from two points or from another form, and the mistakes that trip most people up.

How do you find slope-intercept form?

To find slope-intercept form, you need two things, the slope m and the y-intercept b. Get the slope from two points with m = (y₂ − y₁) ÷ (x₂ − x₁). Then put one point and the slope into y = mx + b and solve for b. Write the result with your numbers in place of m and b.

Example

Find the line through the points (1, 5) and (3, 9).

  1. Slope: m = (9 − 5) ÷ (3 − 1) = 4 ÷ 2 = 2
  2. Use the point (1, 5): 5 = 2 × 1 + b, so b = 3
  3. Equation: y = 2x + 3
  4. Check with the other point (3, 9): 2 × 3 + 3 = 9. It works.

That final check takes ten seconds and catches most mistakes, so it's worth making a habit of it.

What if the slope is a fraction?

Fractions are completely normal here, and a fraction doesn't mean you went wrong. Take the points (4, 0) and (−2, 4). The slope is (4 − 0) ÷ (−2 − 4) = 4 ÷ (−6) = −2/3. Then 0 = −2/3 × 4 + b gives b = 8/3, so y = −2/3x + 8/3. Check with (−2, 4): 4/3 + 8/3 = 12/3 = 4.

Keep the slope as a fraction rather than a rounded decimal, because the fraction is exact and the check will come out perfectly. If fractions are the part that slows you down, a few rounds of the fractions game make adding and simplifying them much quicker.

What do m and b mean in y = mx + b?

In y = mx + b, m is the slope and b is the y-intercept. The slope tells you how much y changes when x goes up by 1, often called rise over run. The y-intercept is the value of y when x = 0, which is the point (0, b) where the line crosses the y-axis.

Example

In y = 3x − 2, the slope is 3 and the y-intercept is −2. The line crosses the y-axis at (0, −2), and every step of 1 to the right takes it 3 up. In y = −2x + 4, the slope is −2, so the line goes down 2 for every step to the right, and it crosses the y-axis at (0, 4).

The textbook OpenStax College Algebra 2e describes slope as "rise over run" and the y-intercept as the point where the input value is zero. A positive slope climbs from left to right, a negative slope falls, and the bigger the number (ignoring its sign), the steeper the line.

A real-life way to picture m and b

A candle is 20 cm tall and burns down 2 cm every hour. Its height after t hours is h = −2t + 20. The 20 is where it starts (b), and −2 is how it changes each hour (m). After 3 hours it's 14 cm tall, and after 10 hours it's gone. Many learners find it easier to think of b as the starting value and m as the change per step.

How do you graph a line in slope-intercept form?

To graph y = mx + b, start at the y-intercept (0, b) on the y-axis. From there, use the slope as rise over run. Move right by the run and up by the rise (or down if the slope is negative) to find a second point. Draw a straight line through both points and extend it.

Example

Graph y = 2x + 1.

  1. Plot the y-intercept (0, 1).
  2. The slope 2 means 2/1, so go 1 to the right and 2 up. That lands on (1, 3).
  3. Draw the line through (0, 1) and (1, 3).

Graph of y = 2x + 1. The line crosses the y-axis at (0, 1), and a step of +1 to the right and +2 up leads to the point (1, 3)

For a slope like −2/3, go 3 to the right and 2 down. Using the denominator as the run keeps you on grid points, so the line is easier to draw accurately.

How do you convert standard form to slope-intercept form?

To convert an equation such as Ax + By = C into slope-intercept form, solve it for y. Move the x term to the other side, then divide every term by the number in front of y. The number in front of x is now the slope, and the number on its own is the y-intercept.

Example

Convert 2x + 3y = 6.

  1. Subtract 2x from both sides: 3y = −2x + 6
  2. Divide every term by 3: y = −2/3x + 2

The slope is −2/3 and the y-intercept is 2. A frequent slip is to read the slope as 2 straight from 2x + 3y = 6. The numbers only mean slope and intercept once y is alone on one side.

Point-slope form or slope-intercept form?

Point-slope form, y − y₁ = m(x − x₁), is handy when you know a point and the slope, because you can write it down immediately. For the point (1, 5) and slope 2 you get y − 5 = 2(x − 1). Expand and simplify, y = 2x − 2 + 5, and you're back at y = 2x + 3. Both forms describe the same line.

Which lines can't be written in slope-intercept form?

Vertical lines can't be written in slope-intercept form. Every point on a vertical line has the same x, so the run is 0 and the slope would mean dividing by zero. That's why the slope of a vertical line is undefined. A vertical line through x = 3 is written simply as x = 3.

Example

The points (3, 1) and (3, 6) are on a vertical line. The slope would be (6 − 1) ÷ (3 − 3) = 5 ÷ 0, which has no answer. So the line is x = 3. A vertical line also never crosses the y-axis unless it is the y-axis itself, so it has no y-intercept to put in place of b.

Horizontal lines are fine. The points (−1, 4) and (5, 4) give a slope of 0 ÷ 6 = 0, so the line is y = 0x + 4, which is just y = 4.

What are the most common slope-intercept form mistakes?

Most mistakes with slope-intercept form are small slips rather than misunderstandings. People swap the coordinates of a point, subtract in a different order on the top and bottom of the slope formula, or read m and b before y is on its own. Checking the finished equation with one of the original points catches nearly all of them.

Quick fixes for each slip

Here are the slips that come up again and again, with a quick fix for each.

  • Mixing up x and y in a point. (5, 7) means x = 5 and y = 7. Say "across, then up" as you read it.
  • Changing the order of subtraction. If you do 9 − 5 on top, do 3 − 1 underneath, with the same point first both times.
  • Swapping m and b. In y = 4 + 3x the slope is still 3, because m is the number attached to x, wherever it sits.
  • Dropping a minus sign. In y = −x + 2 the slope is −1, not 1.
  • Thinking a fraction must be wrong. Slopes like 3/4 or −2/3 are as valid as 2.

Practising slope-intercept form until it feels automatic

Reading lines quickly comes from seeing many of them. In the linear functions game, each attack is a question about a line, so you get plenty of practice spotting slopes and intercepts without it feeling like homework.

A Math Max fight on green hills. Cauliflower lands a punch on a tomato

Solving for b is also just a small one-step equation. If that step is where you slow down, the equations game is a good warm-up.

The letters themselves vary by country. Many schools write the same idea as y = ax + b (for example in France and Poland), y = kx + b (in Russia) or y = mx + q (in Italy). Whatever the letters, the number in front of x is always the slope and the number on its own is where the line crosses the y-axis.

Two numbers describe every line that isn't vertical

Every line that isn't vertical can be written as y = mx + b, so two numbers are enough to describe it completely. The slope says how steep it is and which way it goes, and the y-intercept says where it starts. Find those two numbers, check your equation with a point, and the rest follows.

Enough reading. Go throw some punches.