How to Find Slope from an Equation (y = mx + b): Complete Guide
In y = mx + b the slope is the number multiplying x and the y-intercept is the constant, but only once y is on its own. This guide covers reading m and b directly, rearranging standard form and messier equations, horizontal and vertical lines, eight worked examples, practice questions and the mistakes that cost marks.
Reading the slope off an equation is one of the most used skills in algebra, and it looks trivial right up until the equation arrives in a different shape. y = 3x + 5 gives up its slope at a glance. 2x = 6y − 15 does not, and neither does 3x = 4(y − 5). The rule is the same in every case, though: get y by itself, and the number multiplying x is the slope.
This guide is the deep dive on the equation route. It explains what each part of y = mx + b means, reads m and b from equations that are already in slope-intercept form, rearranges the ones that are not, gives a shortcut for standard form, and deals with the two special cases that trip people up: horizontal and vertical lines. If you are starting from two points or a graph instead, the three-method slope guide covers those routes.
Quick Answer
- Write the equation as y = mx + b, with y alone on the left-hand side.
- The slope m is the coefficient of x (the number multiplying it). In y = −2x + 7, m = −2.
- The y-intercept b is the constant term. In y = −2x + 7, b = 7, so the line crosses the y-axis at (0, 7).
- If y is not alone, isolate it first using inverse operations, then read m and b. For standard form Ax + By = C, the result is always m = −A/B and b = C/B.
- y = b (no x term) is a horizontal line with slope 0. x = a (no y term) is a vertical line whose slope is undefined.
What Is y = mx + b?
y = mx + b is the slope-intercept form of a linear equation. It is the most convenient way to write a straight line, because the two numbers that define the line, its steepness and where it crosses the y-axis, sit in plain view.
Swipe sideways to compare columns.
| Part | Meaning | Example |
|---|---|---|
| m | The slope of the line (how steep it is) | In y = 2x + 1, m = 2 |
| b | The y-intercept (where the line crosses the y-axis) | In y = 2x + 1, b = 1 |
| x | The x-coordinate of any point on the line | For the point (2, 5), x = 2 |
| y | The y-coordinate of any point on the line | For the point (2, 5), y = 5 |
The name describes the two constants. The slope, m, tells you how steep the line is; the intercept, b, tells you where it crosses the y-axis. Take y = 2x + 1: the slope is 2, so the line rises 2 units for every 1 unit it moves right, and the y-intercept is 1, so it crosses the y-axis at (0, 1). The point (2, 5) from the table is on this line, because 2 × 2 + 1 = 5.
What Is Slope (m)?
Slope measures steepness as the ratio of vertical change (rise) to horizontal change (run). A slope of 2 means the line rises 2 units for every 1 unit to the right. For the full derivation from two points, including why the order of subtraction does not matter, see the step-by-step slope calculation guide.
Swipe sideways to compare columns.
| Slope value | What it means | Example |
|---|---|---|
| Positive (m > 0) | Line goes up from left to right | y = 3x + 2 → m = 3 |
| Negative (m < 0) | Line goes down from left to right | y = −2x + 7 → m = −2 |
| Zero (m = 0) | Horizontal (flat) line | y = 5 → m = 0 |
| Undefined | Vertical line | x = 4 → m is undefined |
Reading a slope as a movement makes it easier to graph. m = 2 means rise 2, run 1. m = −3 means fall 3, run 1. m = 1/2 means rise 1, run 2. Any whole-number slope can be written over 1, so the run is always available even when it is not written down. The size of the number also matters: a slope of 5 is steeper than a slope of 2, and a slope of −5 is steeper than a slope of −2, because steepness depends on the absolute value.
Steepness is the size of m, not its sign
Absolute value of the slope for five equations used in this guide. A bigger bar means a steeper line.
y = −5x + 1
m = −5, falling steeply
y = 2x + 3
m = 2, rising
y = x − 7
m = 1, a 45-degree rise
y = (1/2)x − 2
m = 1/2, a gentle rise
y = 6
m = 0, flat
Direction comes from the sign; steepness comes from the absolute value. −5 is steeper than 2.
What Is the Y-Intercept (b)?
The y-intercept is the point where the line crosses the y-axis. Every point on the y-axis has x = 0, so substituting x = 0 into y = mx + b leaves y = b. That is why the constant term is the intercept, and why it is written as the ordered pair (0, b).
Swipe sideways to compare columns.
| Equation | Y-intercept (b) | Ordered pair |
|---|---|---|
| y = 3x + 5 | 5 | (0, 5) |
| y = −2x + 7 | 7 | (0, 7) |
| y = 4x − 3 | −3 | (0, −3) |
| y = x | 0 | (0, 0) |
The sign travels with the number. y = 4x − 3 is the same as y = 4x + (−3), so b = −3, not 3. A line with no constant at all, such as y = x, has b = 0 and passes through the origin.
How to Find Slope from an Equation, Step by Step
From any linear equation to m and b
The same routine works whether the equation starts in slope-intercept form or not.
1. Check the form
Is y alone on one side, with a coefficient of 1? If yes, skip to step 3.
2. Isolate y
Distribute brackets, move x terms and constants across, then divide by the coefficient of y.
3. Read the slope
The coefficient of x is m, sign included. A bare x means m = 1.
4. Read the intercept
The constant term is b, sign included. No constant means b = 0.
5. Check with a point
Pick an x, compute y from your answer, and confirm it satisfies the original equation.
If there is no y term at all (x = a), stop: the line is vertical and the slope is undefined.
For equations already in slope-intercept form, the method is three steps: confirm the form is y = mx + b, identify the coefficient of x as the slope, and identify the constant term as the y-intercept.
Worked Example 1: A basic equation
Find the slope and y-intercept of y = 3x + 5. The equation is already in y = mx + b form. The number in front of x is 3, so m = 3. The constant term is 5, so b = 5. Answer: slope 3, y-intercept 5.
Worked Example 2: A negative slope
Find the slope and y-intercept of y = −2x + 7. The form is correct. The coefficient of x is −2, and the negative sign belongs to it, so m = −2. The constant is 7, so b = 7. Answer: slope −2, y-intercept 7. The line falls 2 units for every 1 unit to the right.
Worked Example 3: An equation with b = 0
Find the slope and y-intercept of y = 4x. Rewrite it as y = 4x + 0 to make the missing constant visible. The coefficient of x is 4, so m = 4, and the constant is 0, so b = 0. Answer: slope 4, y-intercept 0. The line passes through the origin.
Worked Example 4: An equation with m = 1
Find the slope and y-intercept of y = x − 3. When no number is written in front of x, the coefficient is 1, because x = 1x. So m = 1. The constant is −3, so b = −3. Answer: slope 1, y-intercept −3.
Check a Slope with Two PointsPick any two points that satisfy your equation, enter them in the slope calculator, and confirm the rise over run matches the m you read from the equation. It also returns the line in y = mx + b form.How to Rearrange Equations into y = mx + b
Equations often arrive with y buried on the right-hand side, multiplied by a number, or inside brackets. The coefficient of x in those forms is not the slope. Rearrange first, using three steps: isolate y on one side, use inverse operations (add, subtract, multiply, divide) applied to both sides, and write the result as y = mx + b.
Worked Example 5: Rearranging with subtraction
Swipe sideways to compare columns.
| Step | Working | Reason |
|---|---|---|
| 1 | 2x + y = 4 | Original equation |
| 2 | y = −2x + 4 | Subtract 2x from both sides |
| 3 | m = −2, b = 4 | Read the coefficient and the constant |
The slope is −2, not 2. Moving 2x across the equals sign flips its sign, which is exactly why reading the coefficient before rearranging gives the wrong answer.
Worked Example 6: Rearranging with division
Swipe sideways to compare columns.
| Step | Working | Reason |
|---|---|---|
| 1 | 2x = 6y − 15 | Original equation |
| 2 | 2x + 15 = 6y | Add 15 to both sides |
| 3 | y = (2x + 15)/6 | Divide both sides by 6 |
| 4 | y = (1/3)x + 2.5 | Divide each term by 6: 2/6 = 1/3 and 15/6 = 2.5 |
The slope is 1/3 and the y-intercept is 2.5. Check with x = 3: the rearranged equation gives y = 1 + 2.5 = 3.5, and the original gives 2 × 3 = 6 on the left and 6 × 3.5 − 15 = 6 on the right. Both sides match.
Worked Example 7: Rearranging with parentheses
Swipe sideways to compare columns.
| Step | Working | Reason |
|---|---|---|
| 1 | 3x = 4y − 20 | Distribute the 4 |
| 2 | 3x + 20 = 4y | Add 20 to both sides |
| 3 | y = (3x + 20)/4 | Divide both sides by 4 |
| 4 | y = (3/4)x + 5 | Divide each term by 4 |
The slope is 3/4 and the y-intercept is 5. Check with x = 4: y = 3 + 5 = 8, and the original equation gives 3 × 4 = 12 on the left and 4 × (8 − 5) = 12 on the right.
Worked Example 8: Rearranging with a fraction
Swipe sideways to compare columns.
| Step | Working | Reason |
|---|---|---|
| 1 | 0.2x = y + 0.85 | Multiply both sides by 0.2 |
| 2 | y = 0.2x − 0.85 | Subtract 0.85 from both sides |
| 3 | m = 0.2 = 1/5, b = −0.85 | Read the coefficient and the constant |
The slope is 0.2, or 1/5 as a fraction. Decimal and fraction answers are equally correct; use whichever the question asks for. Converting between the two is covered by the decimal to fraction calculator.
The Standard Form Shortcut: m = −A/B
Standard form writes a line as Ax + By = C. Rearranging it in general gives By = −Ax + C, then y = (−A/B)x + C/B. That produces a shortcut worth knowing, and a way to check any rearrangement you do by hand.
Swipe sideways to compare columns.
| Equation | A, B, C | Slope (−A/B) | Intercept | Slope-intercept form |
|---|---|---|---|---|
| 2x + y = 4 | 2, 1, 4 | −2 | 4 | y = −2x + 4 |
| 3x + 4y = 12 | 3, 4, 12 | −3/4 | 3 | y = −(3/4)x + 3 |
| 5x − 2y = 10 | 5, −2, 10 | 5/2 | −5 | y = (5/2)x − 5 |
| 4x − 2y + 6 = 0 | 4, −2, 6 (general form) | 2 | −6/−2 = 3 | y = 2x + 3 |
Standard form is also how pairs of lines are usually written when they need to be solved together. The system of equations calculator takes equations in that shape directly.
Other Forms You Will Meet
Terms in a different order
y = 5 − 2x is already solved for y, just written with the constant first. Reorder it to y = −2x + 5: the slope is −2 and the intercept is 5. The position of a term never changes what it is. The x term is the slope term wherever it sits.
Point-slope form
Point-slope form, y − y₁ = m(x − x₁), shows the slope directly as the number in front of the bracket. In y − 3 = 4(x − 1), m = 4. To find the intercept, expand and isolate y: y − 3 = 4x − 4, so y = 4x − 1 and b = −1. The same line passes through (1, 3), the point the form was built from.
A whole expression over a number
In y = (2x − 6)/3 the slope is not 2. Divide each term by 3: y = (2/3)x − 2. The slope is 2/3 and the intercept is −2.
Parallel and perpendicular lines
Once slopes can be read from any form, comparing lines becomes quick. Parallel lines have equal slopes: −6x + 3y = 12 rearranges to y = 2x + 4, which is parallel to y = 2x + 3. Perpendicular lines have slopes that multiply to −1: y + 2 = −1/2(x − 4) simplifies to y = −(1/2)x, and −1/2 × 2 = −1, so it is perpendicular to both.
Four lines, four slopes
Values of y for x from −3 to 3. The slope sets the steepness and direction; the intercept is the value at x = 0.
- y = 2x + 3 (m = 2)
- y = −5x + 1 (m = −5)
- y = x − 7 (m = 1)
- y = 6 (m = 0)
y = −5x + 1 falls 5 units per step, the steepest of the four. y = 6 does not change at all.
Special Cases: Horizontal and Vertical Lines
Horizontal lines (slope = 0)
A horizontal line has the equation y = b, with no x term. Take y = 3. It fits slope-intercept form as y = 0x + 3, so m = 0 and b = 3. The line is flat at height 3: y never changes as x changes, so the rise is 0 and 0 divided by any run is 0.
Vertical lines (undefined slope)
A vertical line has the equation x = a, with no y term. Take x = 3. Every point on it has x = 3, so between any two points the run is 0, and the slope formula would divide by zero. The slope is undefined. There is no y-intercept either, because the line never meets the y-axis (the only exception is x = 0, which is the y-axis itself). Vertical lines are the one kind of line that cannot be written as y = mx + b at all.
Horizontal vs vertical
The two special cases are easy to mix up because both equations contain a single variable.
Horizontal line
Equation y = b. Example: y = 3.
- Rise is 0 for any run
- Y-intercept is (0, b)
- Fits y = mx + b with m = 0
Vertical line
Equation x = a. Example: x = 3.
- Run is 0, so rise ÷ run divides by zero
- No y-intercept (unless a = 0)
- Cannot be written as y = mx + b
Memory aid: the variable in the equation names the axis the line does not move along. y = 3 keeps y fixed; x = 3 keeps x fixed.
Real-World Applications of y = mx + b
Any quantity that changes at a constant rate from a starting value is a line. The slope is the rate, and the intercept is the starting value.
Swipe sideways to compare columns.
| Application | Equation | Slope means | Intercept means |
|---|---|---|---|
| Business | y = 3x − 50 | $3 profit per item sold | $50 of fixed costs; break-even after 17 items |
| Physics | y = 60x | 60 miles per hour | Starts at 0 miles; 180 miles after 3 hours |
| Savings | y = 100x + 500 | $100 deposited per month | $500 opening balance; $1,700 after 12 months |
| Construction | y = 25x + 200 | $25 labor per hour | $200 of materials; $400 for 8 hours |
| Weather | y = −2x + 70 | Cooling 2 degrees per hour | Starts at 70 degrees; 60 degrees after 5 hours |
| Sports | y = 5x + 40 | An average of 5 points per game | 40 season points so far; 90 after 10 more games |
In the business row, 3x − 50 = 0 at x = 16.67, so the 17th sale is the first one that makes a profit. Break-even, cost and revenue lines are explored further in the slope in business and economics guide. When the rate is not constant, the line is replaced by a curve and slope becomes a derivative, which the secant, tangent and derivative guide walks through.
Practice Questions (With Answers)
- Question 1: Find the slope and y-intercept of y = 7x − 2. Answer: m = 7, b = −2.
- Question 2: Find the slope and y-intercept of y = −3x + 8. Answer: m = −3, b = 8.
- Question 3: Find the slope and y-intercept of y = x + 6. Answer: m = 1, b = 6.
- Question 4: Find the slope and y-intercept of 3x + y = 9. Answer: subtract 3x to get y = −3x + 9, so m = −3 and b = 9.
- Question 5: Find the slope and y-intercept of 2x = 4y + 8. Answer: 2x − 8 = 4y, so y = (1/2)x − 2. m = 1/2, b = −2.
- Question 6: Find the slope and y-intercept of y = 5. Answer: m = 0 (horizontal line), b = 5.
- Question 7: Find the slope and y-intercept of x = 4. Answer: the slope is undefined (vertical line) and there is no y-intercept.
- Question 8: Find the slope and y-intercept of 6x + 3y = 12. Answer: 3y = −6x + 12, so y = −2x + 4. m = −2, b = 4.
- Question 9: Find the slope and y-intercept of x/2 − y/3 = 1. Answer: multiply by 6 to get 3x − 2y = 6, so −2y = −3x + 6 and y = (3/2)x − 3. m = 3/2, b = −3.
Swipe sideways to compare columns.
| Question | Equation | Slope (m) | Y-intercept (b) |
|---|---|---|---|
| 1 | y = 7x − 2 | 7 | −2 |
| 2 | y = −3x + 8 | −3 | 8 |
| 3 | y = x + 6 | 1 | 6 |
| 4 | 3x + y = 9 | −3 | 9 |
| 5 | 2x = 4y + 8 | 1/2 | −2 |
| 6 | y = 5 | 0 | 5 |
| 7 | x = 4 | Undefined | None |
| 8 | 6x + 3y = 12 | −2 | 4 |
| 9 | x/2 − y/3 = 1 | 3/2 | −3 |
Common Mistakes (and How to Avoid Them)
Mistake 1: Confusing slope and y-intercept
In y = 2x + 3, answering slope 3 and intercept 2. The slope is always attached to x; the intercept is the number standing alone. So m = 2 and b = 3.
Mistake 2: Misreading the order of terms
In y = 5 − 2x, answering slope 5 because it comes first. Reorder to y = −2x + 5: m = −2 and b = 5.
Mistake 3: Not isolating y
In 2x + y = 4, answering slope 2. Isolate y first: y = −2x + 4, so m = −2. The same mistake appears when y has a coefficient: in 3x + 4y = 12 the slope is −3/4, not −3, because the 4 has to be divided out.
Mistake 4: Forgetting the hidden coefficient of x
In y = x − 3, answering m = 0 because no number is written. x means 1x, so m = 1. Likewise −x means −1x, so y = −x + 2 has m = −1.
Mistake 5: Mixing up horizontal and vertical lines
Saying y = 3 has an undefined slope. y = 3 is horizontal, so m = 0. x = 3 is vertical, and that is the one with an undefined slope.
Mistake 6: Not simplifying fractions
Leaving y = (2/4)x + 3. The value is correct but unsimplified; write y = (1/2)x + 3. The fraction calculator reduces fractions to lowest terms if the numbers are awkward.
Mistake 7: Skipping the check
A sign error during rearranging produces an answer that looks perfectly reasonable. Pick an easy x value, compute y from your slope-intercept form, and substitute both into the original equation. If the two sides do not match, the rearrangement went wrong somewhere.
Verify Your Rearranged EquationEnter two points from the original equation, for example the two intercepts, and compare the slope and y = mx + b form the calculator returns with your own working.Frequently Asked Questions
What is y = mx + b?
It is the slope-intercept form of a linear equation. m is the slope of the line and b is the y-intercept, the point (0, b) where the line crosses the y-axis.
How do I find the slope from an equation?
Rearrange the equation so that y is alone on one side, in the form y = mx + b. The coefficient of x, including its sign, is the slope. If the equation is already in that form, just read the number in front of x.
How do I find the y-intercept from an equation?
Put the equation in y = mx + b form and read the constant term. Alternatively, substitute x = 0 into the original equation and solve for y; the result is the y-intercept.
What if the equation is not in y = mx + b form?
Isolate y using inverse operations applied to both sides: distribute any brackets, move x terms and constants to the other side, then divide every term by the coefficient of y. Then identify m and b.
How do I find the slope of an equation in standard form?
For Ax + By = C, the slope is −A/B and the y-intercept is C/B, provided B is not zero. For 3x + 4y = 12, the slope is −3/4 and the y-intercept is 3.
What is the difference between slope-intercept form and standard form?
Slope-intercept form is y = mx + b, which shows the slope and intercept directly and is the easiest to graph. Standard form is Ax + By = C, which is convenient for finding both intercepts and for solving systems of equations. Both describe the same line.
What is the slope of a horizontal line?
Zero. A horizontal line has the equation y = b, which is y = 0x + b in slope-intercept form. The y-value never changes, so the rise is always 0.
Can every line be written as y = mx + b?
Every non-vertical line can. Vertical lines, written x = a, cannot, because their slope is undefined and there is no single y value for their one x value. That is why their equation contains no y term.
What does a positive or negative slope mean?
A positive slope means the line rises from left to right, and y increases as x increases. A negative slope means the line falls from left to right, and y decreases as x increases.
What is the slope of y = x?
The slope is 1 and the y-intercept is 0. A variable with no written coefficient has a coefficient of 1, so y = x is y = 1x + 0, a line through the origin at 45 degrees.
Can the slope be a fraction or a decimal?
Yes. y = (1/3)x + 2.5 has a slope of 1/3, and y = 0.2x − 0.85 has a slope of 0.2, which equals 1/5. A fractional slope reads directly as rise over run: 3/4 means rise 3, run 4.
Why is y = mx + b so widely used?
It is the most direct form for graphing: plot the intercept (0, b), then use the slope to step to a second point. It also makes the rate of change and the starting value readable at a glance, which is why it is used for models of cost, distance and savings.
Sources to Verify or Cite
- OpenStax, Elementary Algebra 2e, Section 4.5: Use the Slope-Intercept Form of an Equation of a Line: https://openstax.org/books/elementary-algebra-2e/pages/4-5-use-the-slope-intercept-form-of-an-equation-of-a-line
- Khan Academy, Forms of linear equations (slope-intercept, point-slope and standard form): https://www.khanacademy.org/math/algebra/x2f8bb11595b61c86:forms-of-linear-equations
- Common Core State Standards for Mathematics, Grade 8 Expressions and Equations, 8.EE.B.6 (deriving y = mx + b): https://www.thecorestandards.org/Math/Content/8/EE/
- Common Core State Standards for Mathematics, Grade 8 Functions, 8.F.A.3 (y = mx + b as a linear function): https://www.thecorestandards.org/Math/Content/8/F/
- Wolfram MathWorld, Slope: https://mathworld.wolfram.com/Slope.html
Final Summary
Finding the slope from an equation comes down to one condition: y must be alone. Once it is, the coefficient of x is the slope and the constant is the y-intercept, whatever order the terms appear in. Standard form has its own shortcut, m = −A/B, and the two single-variable equations are the special cases: y = b is horizontal with slope 0, and x = a is vertical with an undefined slope.
- Slope (m): the coefficient of x, sign included, once y is isolated
- Y-intercept (b): the constant term, or the value of y when x = 0
- Not in y = mx + b form: isolate y with inverse operations first
- Standard form Ax + By = C: m = −A/B and b = C/B
- y = b is horizontal (m = 0); x = a is vertical (undefined slope)
- Check every rearrangement by substituting a point into the original equation
Swipe sideways to compare columns.
| Equation | Slope (m) | Y-intercept (b) |
|---|---|---|
| y = 2x + 3 | 2 | 3 |
| y = −5x + 1 | −5 | 1 |
| y = x − 7 | 1 | −7 |
| y = 4x | 4 | 0 |
| y = 6 | 0 | 6 |
| x = 2 | Undefined | None |
Written by
Do The Calculation Team
Do The Calculation
Do The Calculation is built by a small team of data analysts and spreadsheet developers. Where a guide depends on a published formula, standard, or government rule, the calculator it links to names that source directly so you can check the number yourself.
About the team