Linear Function Plotter (y = mx + b)
Plot any linear function y = mx + b instantly. Enter slope, y-intercept and x range to see the graph with intercept values. Free, instant, no login.
How to use this tool
- Enter slope (m), y-intercept (b), x minimum and x maximum in the fields above.
- Results update instantly as you type — or click Calculate.
- Read your slope (m) and the full breakdown beneath it.
A linear function has the form y = mx + b, where m is the slope (rise over run) and b is the y-intercept. Enter any values and the graph updates instantly.
The x-intercept (where the line crosses the x-axis) is found by setting y = 0: x = −b/m.
Formula
y = mx + b
Y-intercept: set x = 0 → y = b
X-intercept: set y = 0 → x = −b ÷ m (undefined when m = 0)
How it works
This tool evaluates the linear equation y = mx + b at 41 evenly spaced x values across the requested range, producing a smooth line plot. It also computes the x-intercept analytically by solving 0 = mx + b. Because a linear function has no curvature, 41 points are more than sufficient for a visually accurate graph across any finite range.
Worked example
- Slope m = 2, y-intercept b = 1. Function: y = 2x + 1.
- Y-intercept: x = 0 → y = 1.
- X-intercept: 0 = 2x + 1 → x = −1 ÷ 2 = −0.5.
- Range x = −10 to 10; at x = −10: y = −19; at x = 10: y = 21.
Slope = 2, y-intercept = 1, x-intercept = −0.5.
Common mistakes to avoid
- Setting slope to 0 and expecting a non-zero x-intercept — a horizontal line never crosses the x-axis unless b=0 also, so the x-intercept is undefined.
- Confusing the sign of the slope: a negative slope produces a line falling left to right, which surprises users who expect a mirrored upward line.
- Choosing an x-range so narrow that the line appears nearly vertical or as a single point, making slope direction impossible to read on the chart.
Key terms
- Slope (m)
- The rate of change of y with respect to x; a slope of 2 means y increases by 2 for every 1-unit increase in x.
- Y-intercept (b)
- The value of y when x = 0; the point where the line crosses the vertical axis.
- X-intercept
- The value of x when y = 0; the point where the line crosses the horizontal axis, found by solving −b ÷ m.
- Linear function
- A function of the form y = mx + b whose graph is a straight line with constant slope; it has exactly one x-intercept unless the line is horizontal (m = 0).
Frequently asked questions
- What does the slope mean?
- The slope m tells you how much y changes for every 1-unit increase in x. A slope of 2 means y goes up 2 for every 1 step to the right.
- What if the slope is zero?
- A slope of zero gives a horizontal line at y = b, with no x-intercept (unless b is also 0, in which case the whole x-axis is the line).