Part 7 of 10 · LinesSee the whole course

How to graph a line from its equation

Short answer

To graph y = mx + b, put a dot at b on the y-axis. From there, go across 1 and up m (down if m is negative) to mark the next dot. Repeat, then draw a straight line through the dots.

The steps

  1. Get y alone. Make sure the equation looks like y = mx + b.
  2. Start at b. Put a dot at (0, b) on the y-axis.
  3. Step by the slope. Write the slope as rise ÷ run. Go across by the run, then up (or down) by the rise, and put a dot.
  4. Repeat once more for a third dot.
  5. Draw the line through the dots with a ruler, and extend it past them.

Try it. Pick an equation, then take the steps one at a time.

start (0, −1), then up 2 across 1
Two dots are enough to draw the line.

Example 1: y = 2x − 1

The y-intercept is −1, so the first dot is (0, −1). The slope is 2, which is 2 ÷ 1: up 2, across 1.

Start: (0, −1)
Up 2, across 1: (1, 1)
Up 2, across 1: (2, 3)

Draw the line through (0, −1), (1, 1) and (2, 3).

Example 2: a fraction slope, y = −⅔x + 4

Start at (0, 4). The slope is −2 ÷ 3. The top of the fraction is the rise and the bottom is the run: down 2, across 3.

Start: (0, 4)
Down 2, across 3: (3, 2)
Down 2, across 3: (6, 0)

Check one dot in the rule: at x = 3, y = −⅔ × 3 + 4 = −2 + 4 = 2. It works.

Example 3: the equation is not in y = mx + b form

Take 3x + 2y = 6. Get y alone first:

2y = −3x + 6
y = −1.5x + 3

Now b = 3 and the slope is −1.5, which is −3 ÷ 2: down 3, across 2.

Start: (0, 3)
Down 3, across 2: (2, 0)
Down 3, across 2: (4, −3)

Check the last dot in the original equation: 3(4) + 2(−3) = 12 − 6 = 6. It works.

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

Name the first three dots for each line. Tap a question to see the answer.

1. y = x + 2

Start (0, 2). The slope is 1, up 1 across 1: (1, 3), then (2, 4).

2. y = −2x + 5

Start (0, 5). The slope is −2, down 2 across 1: (1, 3), then (2, 1).

3. y = ½x − 3

Start (0, −3). The slope is ½, up 1 across 2: (2, −2), then (4, −1).

Where graphing fits in

Graphing a line is slope-intercept form put to work, so if the letters m and b are new, read slope-intercept form explained first. Next in this course, we go the other way: write the equation of a line from two points.

Quick answers

Questions about this topic

How do you graph a line from an equation?

Put a dot at b on the y-axis, step across 1 and up by the slope to mark the next dot, repeat for a third dot, and draw a straight line through them.

How do you graph a line with a fraction slope?

Use the top of the fraction as the rise and the bottom as the run. For a slope of 2/3, go up 2 and across 3. If the slope is negative, go down instead of up.

How do you graph an equation that is not in y = mx + b form?

Get y alone first. For 3x + 2y = 6, subtract 3x from both sides and divide by 2 to get y = −1.5x + 3, then graph it as usual.

How many points do you need to graph a line?

Two points are enough to draw a line, but a third point is a good check. If all three sit on one straight line, you probably did it right.

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.