How to Write an Equation from a Graph?
Write an Equation from a Graph
Given a line on a graph, you can recover its equation by reading two things off the grid: the y-intercept and the slope. Drop them into \(y = mx + b\) and you’ve captured the line. We’ll read several together, with a solver, practice, and a worksheet maker a tap away.
Write an Equation from a Graph: what to notice and how to work it
What to notice first
Common student mistake
Key formulas and cues
A reliable path
- Simplify each sideDistribute and combine like terms before moving variables.
- Collect variablesUse inverse operations to get variable terms on one side and constants on the other.
- Check in the originalSubstitute the solution into the original equation, the simplified line.
Worked examples
Two-step equation
- Subtract 5 from both sides.
- Divide both sides by 3.
- Check 3(5) + 5 = 20.
Variables on both sides
- Subtract 2x from both sides.
- Add 7 to both sides.
- Divide by 2.
Try one before moving on
Write an Equation from a Graph: pop-up practice

When a line is drawn on a coordinate grid, you can recover its equation just by reading the picture. Two features do it: where the line crosses the y-axis (that’s \(b\)) and how steeply it climbs or falls (that’s \(m\)). Put them into \(y = mx + b\) and you’ve turned a graph back into algebra.
In short: read the y-intercept off the graph, count the slope as rise over run between two clear points, then write \(y = mx + b\). A line crossing at \((0,1)\) that rises 2 for every 1 across is \(y = 2x + 1\).
Read Two Things Off the Grid
The y-intercept is the spot where the line meets the vertical axis, read its y-value directly. For the slope, pick two points the line passes through cleanly (lattice points), then count the vertical change over the horizontal change between them.
How to do it (3 steps):
- Find the y-intercept \(b\) where the line crosses the y-axis.
- Count the slope \(m\) (rise over run) between two grid points.
- Write \(y = mx + b\).
From graph to \(y = 2x + 1\)
This line crosses the y-axis at \((0,1)\), so \(b = 1\). From \((0,1)\) to \((2,5)\) it rises 4 and runs 2, so \(m = 2\). The equation is \(y = 2x + 1\).
Read a line’s equationWorked Examples
Read the intercept, count the slope, the line below shows each one on the grid.
Example A, Positive slope
A line crosses at \((0,1)\) and passes \((2,5)\).
- Read the y-intercept: \(b = 1\).
- Count the slope: \(m = \dfrac{5 – 1}{2 – 0} = 2\).
- Write it: \(y = 2x + 1\).
Answer: \(y = 2x + 1\)
Example B, Negative slope
A line crosses at \((0,3)\) and passes \((1,1)\).
- Read the y-intercept: \(b = 3\).
- Count the slope: \(m = \dfrac{1 – 3}{1 – 0} = -2\) (falls to the right).
- Write it: \(y = -2x + 3\).
Answer: \(y = -2x + 3\)
Example C, Through the origin
A line crosses at \((0,0)\) and passes \((2,6)\).
- The line crosses at the origin, so \(b = 0\).
- Count the slope: \(m = \dfrac{6 – 0}{2 – 0} = 3\).
- Write it: \(y = 3x\).
Answer: \(y = 3x\)
Example D, A gentle slope
A line crosses at \((0,2)\) and passes \((4,4)\).
- Read the y-intercept: \(b = 2\).
- Count the slope: \(m = \dfrac{4 – 2}{4 – 0} = \tfrac12\).
- Write it: \(y = \tfrac12 x + 2\).
Answer: \(y = \tfrac12 x + 2\)
Where You’ll Use It
Reading a line off a graph is how you turn a chart into a usable formula, a trend line on a scatter plot, a distance-time graph, a supply curve. Once you have \(y = mx + b\), you can predict values the graph doesn’t directly show.
Slip-Ups That Cost Easy Points
- Reading run over rise. Slope is vertical change over horizontal change, count up/down first.
- Missing a negative slope. If the line falls to the right, \(m\) is negative.
- Guessing between gridlines. Use points where the line hits exact lattice corners.
- Stopping at the slope. Include the y-intercept; the equation needs both \(m\) and \(b\).
Your Turn: Write the Equation
Each line crosses at the first point and passes through the second. Write \(y = mx + b\). Reveal to check.
- \((0,0)\) and \((2,6)\)
- \((0,5)\) and \((5,0)\)
- \((0,-4)\) and \((2,2)\)
- \((0,2)\) and \((4,4)\)
Show answers
- \(\color{blue}{y = 3x}\)
- \(\color{blue}{y = -x + 5}\)
- \(\color{blue}{y = 3x – 4}\)
- \(\color{blue}{y = \tfrac12 x + 2}\)
Make Your Own Worksheet
Generate fresh read-the-graph problems with a full answer key, print or save as a PDF.
Frequently Asked Questions
How do I write an equation for a graph?
For a straight line, read two things from the graph: where the line crosses the y-axis (b) and how steep it is (the slope, m). Then write y = mx + b. If a line crosses the y-axis at 2 and passes through (3, 8), the slope is (8 − 2)/(3 − 0) = 2, so the equation is y = 2x + 2. Check by plugging in another point on the line.
How do you write an equation from a graph in slope-intercept form?
Pick two points where the line crosses the grid exactly, find the slope as rise over run, and read the y-intercept. Suppose a line passes through (0, 5) and (2, 1). Moving right 2 units, it drops 4, so m = −4/2 = −2. The intercept is 5, giving y = −2x + 5. A line that falls from left to right always has a negative slope.
How do you write an equation from a graph in standard form?
First write the slope-intercept equation, then rearrange it into Ax + By = C with whole-number coefficients. A line through (0, 3) and (6, 0) has slope −3/6 = −1/2, so y = −(1/2)x + 3. Multiply every term by 2 to get 2y = −x + 6, then add x to both sides: x + 2y = 6. Both points check: 0 + 6 = 6 and 6 + 0 = 6.
How do you write an equation from a graph using a table?
Read several points off the graph and list them in an x-y table. Then look at how y changes each time x goes up by 1; that constant change is the slope. For points (0, −1), (1, 2) and (2, 5), y rises by 3 each step, and when x = 0, y = −1. So the equation is y = 3x − 1. Test a fourth point from the graph to be sure.
How do you write an equation from a quadratic graph?
For a parabola, use vertex form y = a(x − h)² + k. Read the vertex (h, k) from the graph, then use one more point to find a. If the vertex is (1, −4) and the parabola passes through (3, 0), then 0 = a(3 − 1)² − 4, so 4a = 4 and a = 1. The equation is y = (x − 1)² − 4.
Related Topics
Continue Your Study
Ready for the next step? Pick up right where this lesson leaves off:
Related to This Article
More math articles
- How to Prepare for the SSAT Middle-Level Math Test?
- Top 10 7th Grade MEAP Math Practice Questions
- Common Prefixes
- The Centroid and Its Role in Triangles
- Loyalty Programs, HUAC, McCarthyism and Civil Liberties
- Public Health, Medical Ethics and Postwar Science
- ACT Math- Test Day Tips
- How to Find Inverses of 2×2 Matrices?
- Ideological groups
- Top 10 SHSAT Prep Books (Our 2023 Favorite Picks)


What people say about "How to Write an Equation from a Graph (y = mx + b)"?
No one replied yet.