Slope-Intercept Form: Interactive y = mx + b Grapher

Drag the Slope m and Intercept b sliders and the line y = mx + b redraws live: b pins the y-intercept at (0, b), m sets the rise for every run of 1, with a worked graphing recipe and examples.

Drag the two sliders and watch the line respond: m tilts it, b slides it up and down. The equation rewrites itself with your numbers.

Interactive slope-intercept graphery = x + 2. Slope 1, y-intercept at (0, 2), x-intercept at (-2, 0). From the y-intercept, moving right 1 changes y by the slope.-5-5-4-4-3-3-2-2-1-11122334455+1+1(0, 2)(-2, 0)
y = x + 2
y-intercept: (0, 2)
x-intercept: (-2, 0)
right 1 → up 1

y = x + 2. Slope 1, y-intercept at (0, 2), x-intercept at (-2, 0). From the y-intercept, moving right 1 changes y by the slope.

What is slope-intercept form?

Slope-intercept form is the standard way to write a linear equation so that its graph can be read straight off the symbols:

y = mx + b

Every symbol has one job, and every job is on screen in the grapher above:

SymbolMeaningIn the grapher
mthe slope: how much y changes when x increases by 1the Slope m slider (-4 to 4, steps of 0.5)
bthe y-intercept: the height where the line crosses the y-axisthe Intercept b slider (-4 to 4, steps of 0.5)
xany input: a horizontal position on the gridthe horizontal axis
ythe output the rule gives back for that xthe vertical axis

The grapher starts at m = 1 and b = 2, so its equation box reads y = x + 2. Move either slider and the line redraws instantly, the equation rewrites itself with your numbers, and the labeled dots track both intercepts. The Reset button returns you to y = x + 2 at any time.

Behind the graph, y = mx + b is just a rule: take any x, multiply it by m, add b, and out comes the matching y. Plot every (x, y) pair the rule produces and they all land on one straight line. That is why two numbers are enough to describe the entire line.

What do m and b mean?

m is the slope. It answers one question: when x increases by 1, how much does y change? The grapher draws that as a dashed triangle sitting on the y-intercept: a teal leg marked +1 running right, and an amber leg showing the rise, which always equals m. The readout says the same thing in words, right 1 → up 1 at the default. Bigger m, steeper climb; negative m, the line falls instead. The slope lesson shows how to compute m from any two points on a line.

b is the y-intercept. It is the y-value where the line crosses the y-axis, so the line always passes through the point (0, b). At the default settings the grapher marks it with a dot labeled (0, 2).

The trap: b is not an x-value. Students see y = 2x - 3 and plot a point at (-3, 0), three units along the x-axis. Wrong axis. The -3 is a height: the line crosses the y-axis at (0, -3), three units down. The grapher makes the difference impossible to miss because it labels both crossings. At the default y = x + 2, the y-intercept dot reads (0, 2) while the x-intercept dot reads (-2, 0). Same b = 2, yet the line crosses the x-axis at negative 2. If b were an x-value those two labels would match; they do not.

How to graph a linear equation from y = mx + b

Graphing linear equations from slope-intercept form is a two-step recipe:

  1. Plot the y-intercept. Mark the point (0, b) on the y-axis.
  2. Step with the slope. From (0, b), move right 1 and up m (down if m is negative). Mark the point. Repeat once more for a third point.
  3. Draw the line through the points and extend it in both directions.

Worked example: y = 2x - 3. Here m = 2 and b = -3.

Draw the straight line through (0, -3), (1, -1), and (2, 1). Both sliders can reach these exact numbers, so you can verify every point of this example live:

If the slope is a fraction, the same recipe works with a wider step. For m = 0.5 (a reachable slider value), going right 1 rises only 0.5, so it is often cleaner to go right 2 and up 1: the same slope, landed on whole-number grid points.

Changing m vs changing b

The two sliders never do each other’s job, and that separation is the whole point of the form:

You changeThe line…What stays fixed
m larger (toward 4)tilts steeper uphill; the rise readout growsthe y-intercept (0, b)
m negativefalls left to right; the readout flips to “down”the y-intercept (0, b)
m = 0goes flat; the x-intercept readout says “none (horizontal line)“the y-intercept (0, b)
b largerslides straight up, tilt unchangedthe slope readout’s number
b smallerslides straight down, tilt unchangedthe slope readout’s number

In short: m pivots, b slides. Pick a tilt, pick a height, and the line is fully determined. The one number that responds to both sliders is the x-intercept, because where a line crosses the x-axis depends on its tilt and its height together: solving 0 = mx + b gives x = -b/m, which is exactly the value the grapher’s x-intercept readout reports.

When slope-intercept form is the right tool

Slope-intercept form is the fastest form for graphing and for reading a graph back into an equation: spot where the line crosses the y-axis (that is b), count the rise for one step right (that is m), and write y = mx + b. It is also the best form for comparing lines: two lines with the same m are parallel, and writing two equations in this form sets up systems of equations, where the point the two lines cross is the solution.

It is not always the least work, though. If you know the slope and a point that is not the y-intercept, say m = 2 through (3, 5), slope-intercept form makes you solve for b first. Point-slope form takes that information as-is. Both forms describe the same lines; you are only choosing which starting facts to plug in.

The grapher above also works as a y = mx + b calculator: set m and b and read the equation, both intercepts, and the graph straight off the screen.

It’s free to embed on your own site or LMS. Next, practice reading m from any two points in the slope lesson, or graph a line from any known point with point-slope form.

Frequently asked questions

What is slope-intercept form?
Slope-intercept form writes a linear equation as y = mx + b, where m is the slope and b is the y-intercept. It is the most useful form for graphing because both numbers read straight off the equation: the line crosses the y-axis at the point (0, b) and rises m units for every 1 unit it runs to the right.
What is b in y = mx + b?
b is the y-intercept: the y-coordinate of the point where the line crosses the y-axis. The line always passes through (0, b). It is not an x-value; for y = 2x - 3, the line crosses the y-axis at (0, -3), not at (-3, 0).
What is m in y = mx + b?
m is the slope: how much y changes each time x increases by 1. A slope of 2 means the line rises 2 for every 1 it runs right; a slope of -2 means it falls 2. The bigger the size of m, the steeper the line, and m = 0 gives a flat, horizontal line.
What does y = mx + b mean?
It is a rule that turns any x into a y: multiply x by the slope m, then add b. Every (x, y) pair the rule produces lands on one straight line, and the two constants describe that line completely: b sets where it crosses the y-axis, and m sets how steeply it climbs or falls.
How do you graph an equation in slope-intercept form?
Two steps. First plot the y-intercept, the point (0, b). Then use the slope as rise over run: from (0, b), move right 1 and up m (down if m is negative) to mark a second point, and repeat for a third. Draw the line through the points. For y = 2x - 3 that gives (0, -3), (1, -1), and (2, 1).
When should I use slope-intercept form instead of point-slope form?
Use slope-intercept form when you know the slope and the y-intercept, or when you want to graph quickly or compare two lines. Use point-slope form, y - y₁ = m(x - x₁), when you know the slope and a point that is not the y-intercept; it saves you from solving for b first.

Sources

Last reviewed: 2026-07-02

Embed this on your site

Free to use. Paste this anywhere; a link back to PrepOK is included.

Related