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.

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
A. Positive slope
A line crosses at \((0,1)\) and passes \((2,5)\).
\(b = 1\), slope \(= \tfrac{5-1}{2-0} = 2\). \(y = 2x + 1\).
B. Negative slope
A line crosses at \((0,3)\) and passes \((1,1)\).
\(b = 3\), slope \(= \tfrac{1-3}{1-0} = -2\). \(y = -2x + 3\).
C. Through the origin
A line crosses at \((0,0)\) and passes \((2,6)\).
\(b = 0\), slope \(= 3\). \(y = 3x\).
D. A gentle slope
A line crosses at \((0,2)\) and passes \((4,4)\).
\(b = 2\), slope \(= \tfrac{4-2}{4-0} = \tfrac12\). \(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 a line’s equation from a graph?
Read the y-intercept where the line crosses the y-axis, count the slope as rise over run between two grid points, then write \(y = mx + b\).
Which two points should I pick for the slope?
Choose points where the line passes exactly through grid intersections, so the rise and run are whole numbers you can count confidently.
How do I know if the slope is negative?
If the line goes down as you move to the right, the slope is negative; if it goes up, it’s positive.
What if the line is horizontal or vertical?
A horizontal line is \(y = b\) (slope 0); a vertical line is \(x = a\) (undefined slope) and can’t be written as \(y = mx + b\).
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
- The Best SAT Math Book for Students Starting From the Basics
- Overview of the ACCUPLACER Math Test
- Can Dice Models Compete with Lightning-Fast Layer 2 Systems?
- Delaware DeSSA Grade 8 Math Free Worksheets: Printable Test-Prep Worksheets with Answer Keys
- 6th Grade WVGSA Math Worksheets: FREE & Printable
- The Best Grade 5 ELA Practice Tests for Maine Students
- How to Complete a Table and Graph a Two-Variable Equation?
- Word Problems: Multiplication for 4th Grade
- Order of Operations for 5th Grade: PEMDAS Made Easy
- 8th Grade GMAS Math Worksheets: FREE & Printable

















What people say about "How to Write an Equation from a Graph? - Effortless Math: We Help Students Learn to LOVE Mathematics"?
No one replied yet.