# How Do You Write an Equation of a Line?

Find the slope of the line (m), and the place where the line crosses the y-axis, known as the y-intercept (b), to write the equation in slope-intercept form, y = mx + b. Use the equation to find the y value for any x on that line.

1. Use any two points on the line to find the slope

Subtract the y-coordinate of one point from the y-coordinate of the other point. Repeat by subtracting the x-coordinate from that same first point from the x-coordinate from the other point. Divide the difference between the y-coordinates by the difference between the x-coordinates to find the slope, or the degree of rise, in the line.

2. Find the y-intercept of the line

Look at the graph to see if the line already crosses the y-axis. Draw a line with a straightedge through the existing point until the line crosses the y-axis, if necessary. Write down the value of the y-axis point where the line crosses it.

3. Insert the slope and y-intercept into the standard slope-intercept formula

Replace the m in y = mx + b with the slope, and replace the b with the y-intercept. Check your work by plugging other x values into the equation to see if the y values appear on the line.

Similar Articles