Math Solver Free

Math Guides

How to Graph Linear Equations Step by Step (3 Ways)

Math Solver Free Team

A teen studying geometry with books, a notebook and a laptop
Graph of y = 2x plus 3 with a rise-over-run triangle from (0, 3) to (1, 5) showing rise 2 and run 1

To graph a linear equation is to draw every point (x, y) that makes the equation true. Those points always form a straight line, which is why the equation is called linear. Once you can graph linear equations fluently, you can see solutions, compare rates, and solve systems by eye. This guide teaches three reliable ways to do it: slope-intercept form, a table of values, and intercepts, with a fully worked example for each.

The key idea is simple: two points determine a line. Whatever method you use, your job is to find two points that satisfy the equation, plot them accurately, and draw a straight line through them that extends beyond both points in both directions. A third point is your check: if it does not land on the line, one of your points is wrong.

Slope-intercept form: the fastest starting point

Most graphing starts with slope-intercept form, y = mx + b. The letter m is the slope: how much y changes for each step in x, written as rise over run. The letter b is the y-intercept: the value of y when x = 0, which is the point (0, b) where the line crosses the y-axis. In y = 2x + 3, the slope is 2 and the y-intercept is 3. In y = −x/2 + 4, the slope is −1/2 and the y-intercept is 4.

Reading m and b correctly is half the skill. A slope of 2 means rise 2, run 1. A slope of −3/4 means fall 3, run 4 (or, equivalently, rise 3, run −4, but moving right is easier to plot). A slope of 1/3 means rise 1, run 3. Always write a whole-number slope as a fraction over 1, so the rise and the run are both visible: 2 = 2/1.

Method 1: plot the intercept, then use the slope

This is the quickest method when the equation is already in y = mx + b form.

  1. Identify m and b. Plot the y-intercept (0, b) first.
  2. From the intercept, use the slope as rise over run to find a second point: move up or down by the rise, then right by the run.
  3. Repeat the slope step once more for a third, checking point.
  4. Draw a straight line through the points with arrows at both ends, showing it continues forever.

Worked example. Graph y = 2x + 3. The y-intercept is (0, 3): plot it. The slope 2 = 2/1 means rise 2, run 1. From (0, 3), go up 2 and right 1 to reach (1, 5). Repeat: up 2, right 1 to reach (2, 7). Draw the line through (0, 3), (1, 5), and (2, 7). Check with the equation: at x = 2, y = 2(2) + 3 = 7. The point sits on the line, so the graph is correct.

For a negative slope, keep the run positive and let the rise carry the sign. To graph y = −2x + 1, start at (0, 1), then go down 2 and right 1 to (1, −1), then down 2 and right 1 again to (2, −3). The line falls as it moves right, exactly as a negative slope should.

Method 2: build a table of values

A table works for any form of equation, and it is the best choice when the equation is not yet in y = mx + b form or when you want to be certain about tricky fractions.

  1. Choose three x-values that make the arithmetic easy. Include 0, and pick values that clear any fractions.
  2. Substitute each x into the equation and compute y. Write each result as a point (x, y).
  3. Plot the three points and draw the line through them. If the third point misses the line, recompute.

Worked example. Graph y = −x/2 + 4. The fraction suggests choosing even x-values. At x = 0, y = 4, giving (0, 4). At x = 2, y = −1 + 4 = 3, giving (2, 3). At x = 4, y = −2 + 4 = 2, giving (4, 2). Plot (0, 4), (2, 3), and (4, 2) and draw the line. Notice the pattern: each step of 2 in x drops y by 1, which matches the slope −1/2. That pattern check is a fast way to spot an arithmetic slip.

Tables also handle equations like y = 3x − 5 cleanly: x = 0 gives (0, −5), x = 1 gives (1, −2), x = 2 gives (2, 1). The y-values jump by 3 each time, which is the slope showing itself in the table.

Method 3: use the x-intercept and y-intercept

The intercept method is fastest for equations in standard form, ax + by = c, because both intercepts come from one substitution each.

  1. Find the y-intercept by setting x = 0 and solving for y.
  2. Find the x-intercept by setting y = 0 and solving for x.
  3. Plot both intercepts and draw the line through them.
  4. If both intercepts are (0, 0), the line passes through the origin: pick any other x-value to get a second point.

Worked example. Graph 3x + 2y = 6. Set x = 0: 2y = 6, so y = 3, giving the y-intercept (0, 3). Set y = 0: 3x = 6, so x = 2, giving the x-intercept (2, 0). Plot (0, 3) and (2, 0) and draw the line. Check with a third point: at x = 4, 3(4) + 2y = 6 gives 2y = −6, so y = −3, and (4, −3) lies on the line. Correct.

Through the origin. For y = 2x, both intercepts are (0, 0), so the intercept method alone gives only one point. Choose x = 1 to get (1, 2) and draw the line through (0, 0) and (1, 2). The same fix applies to any equation with no constant term.

Horizontal and vertical lines

Two special lines break the usual routine, and tests love them. A horizontal line has the form y = c: every point has the same y-value. The line y = 4 passes through (0, 4), (1, 4), and (−3, 4); its slope is 0. A vertical line has the form x = c: every point has the same x-value. The line x = −2 passes through (−2, 0), (−2, 5), and (−2, −4); its slope is undefined, because the run is 0 and division by zero is impossible. Never confuse the two: slope 0 is a real number, but undefined slope means the slope does not exist.

Converting standard form before graphing

If your equation arrives as 2x + y = 8, either method works, but converting to slope-intercept form first makes the slope method available. Subtract 2x from both sides: y = −2x + 8. Now the y-intercept is (0, 8) and the slope is −2, so from (0, 8) go down 2 and right 1 to (1, 6), then to (2, 4). Check with the original: 2(2) + 4 = 8. Correct. Converting first is also how you read the slope of a line given in standard form, which is a common exam question on its own.

Common mistakes to avoid

  • Plotting (b, 0) instead of (0, b). The y-intercept sits on the y-axis, where x = 0. Swapping the coordinates is the single most common graphing error.
  • Flipping rise and run. Slope is rise over run: the vertical change goes on top. A slope of 3/2 means up 3, right 2, not up 2, right 3.
  • Drawing a segment instead of a line. A graph of an equation extends forever in both directions. Add arrows, and do not stop at your plotted points.
  • Ignoring the sign of a negative slope. A negative slope falls from left to right. If your line rises while m is negative, the sign went missing somewhere.
  • Using only one point. One point never determines a line. Always plot at least two, and use a third as a check.
  • Skipping the check. Substitute one plotted point back into the original equation. Thirty seconds here saves a lost mark.
Graph of 3x plus 2y equals 6 with x-intercept (2, 0) and y-intercept (0, 3) marked

Practice: try these, then check

Graph each equation and name two points on the line: (1) y = 3x − 2; (2) y = −x/3 + 2; (3) x + 2y = 4; (4) y = −3. Answers: (1) (0, −2), (1, 1); (2) (0, 2), (3, 1); (3) intercepts (4, 0) and (0, 2); (4) a horizontal line through (0, −3). If a point fails the equation, rework only the step that produced it. To explore slopes interactively, try our free slope calculator, and for the slope behind every graph, read our slope guide and the linear equations guide. For a second explanation with diagrams, see FreeMathHelp on graphing lines.

About the MathSolverFree Team

The MathSolverFree Team builds and maintains the calculators and step-by-step solvers on this site. Every tool is checked against worked textbook examples before it is published, and the method behind each solver is written out in full — in the worked examples on the page and in our guides — so you can see exactly how an answer is reached, not just the answer itself.

How we build and test our tools·More about the team