Slope-intercept form
Slope-intercept form writes a straight line as y = mx + b, where m is the slope and b is the y-intercept. It is the most useful way to write a line, because you can read both numbers straight off the equation and draw the graph in seconds.
The formula
- m is the slope: how far the line goes up for each 1 you move right. A positive m rises, a negative m falls, and a larger size means steeper.
- b is the y-intercept: where the line crosses the y-axis, at the point (0, b).
In y = 2x + 1, the slope is 2 and the line crosses the y-axis at (0, 1). In y = -3x + 4, the slope is −3 and the intercept is (0, 4). In y = 5x, there is no number on the end, so b = 0 and the line goes through the origin.
How to graph a line in slope-intercept form
To graph y = 2x + 1:
- Plot the y-intercept. b = 1, so put a point at (0, 1).
- Use the slope to find another point. m = 2 means up 2 for every 1 right, so from (0, 1), move to (1, 3). If the slope is a fraction, like 2/3, it tells you directly: up 2, right 3.
- Draw the line through the two points and extend it in both directions.
For a negative slope like −3, go down 3 for every 1 right.
How to write the equation of a line
From a graph
Read where the line crosses the y-axis to get b. Then pick two clear points and work out rise ÷ run to get m.
From two points
For (1, 3) and (3, 7):
- Find the slope: m = (7 − 3) ÷ (3 − 1) = 4 ÷ 2 = 2.
- Put m and one point into y = mx + b: 3 = 2(1) + b.
- Solve for b: b = 1.
- Write the answer: y = 2x + 1.
The slope calculator does this for any two points, and keeps fractions exact.
From a slope and a point
With slope 3 through (2, 5): 5 = 3(2) + b, so b = −1, and the line is y = 3x − 1.
Converting from standard form
To turn a line in standard form, Ax + By = C, into slope-intercept form, solve for y:
- Start with 3x + 2y = 8.
- Subtract 3x from both sides: 2y = −3x + 8.
- Divide everything by 2: y = −(3/2)x + 4.
So the slope is −3/2 and the y-intercept is 4. In general, y = −(A/B)x + C/B.
Parallel and perpendicular lines
Parallel lines have the same slope. So y = 2x + 1 and y = 2x − 3 never meet.
Perpendicular lines have slopes that multiply to −1: flip the slope and change its sign. A line perpendicular to y = 2x + 1 has slope −1/2.
What m and b mean in real life
Slope-intercept form describes anything with a fixed starting value and a steady rate of change. A taxi charging a $3 fee plus $2 per mile costs y = 2x + 3 dollars for x miles: the slope is the rate per mile, and the intercept is the fixed fee.
A phone with 80% charge that loses 5% per hour has y = −5x + 80: the negative slope means the value falls over time.
Common mistakes
- Mixing up m and b. m multiplies x, and b stands alone. In y = 4 + 3x, the slope is 3, not 4.
- Plotting the slope backwards. A slope of 2/3 is up 2, right 3. The rise is on top.
- Forgetting a negative sign in b. y = 2x − 5 crosses the y-axis at (0, −5).
- Trying to write a vertical line this way. A vertical line has no defined slope, so it can’t be written as y = mx + b. It looks like x = 3.
Frequently asked questions
What is slope-intercept form?
How do you find the slope from y = mx + b?
What is the difference between slope-intercept form and point-slope form?
What is b if the line goes through the origin?
Can every line be written in slope-intercept form?
Keep going
The other way to write a line, from a point and a slope.
Slope and equation from any two points.
What y = mx + b looks like, in detail.
The coordinate plane these lines live on.
Where two lines meet.
For drawing lines by hand.
Every figure on this page opens in ihateDesmos, where you can drag sliders and watch the graph respond.