Equation of a Line Between Two Points
(KS4, Year 10)

The Lesson

A linear equation is an equation that represents a line. If we are given two points, we can draw a line between them. If we know the Cartesian coordinates of the two points, then we can find the equation of the line. The image below shows what we mean by two points (x1, y1) and (x2, y2) being joined by a line:

The equation of the line between the points is given by the formula:

  • y and x are the Cartesian coordinates of points on the line.
  • (x1, y1) and (x2, y2) are two points on the line.

How to Find the Equation of a Line Between Two Points

Finding the equation of a line between two points is easy.


What is the equation of the line that passes through the points (1, 2) and (4, 8)?



Start with the formula:
$$y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1)$$


Find the Cartesian coordinates of the points. In our example:
  • The first point is (1, 2), so x1 = 1 and y1 = 2.
  • The second point is (4, 8), so x2 = 4 and y2 = 8.


Substitute x1, y1, x2 and y2 into the formula.
$$y - 2 = \frac{8 - 2}{4 - 1}(x - 1)$$


Tidy up the equation.
$$y - 2 = \frac{6}{3}(x - 1)$$ $$y - 2 = 2(x - 1)$$


The equation of the line between the points (1, 2) and (4, 8) is y − 2 = 2(x − 1).

Lesson Slides

The slider below gives another example of finding the equation of a line passing through two points Open the slider in a new tab

Why Does the Formula Work?

The equation of a line between two points in made up of two equations. Start with the slope-point form of a linear equation:

Then replace the slope m with the formula for the slope between two points:

Alternative Formulas

It does not matter which of the two points is used to be subtracted from the x and the y in the formula. The following forms of the equation can both be used:


When Points Have Negative Coordinates

In the formula, the y-coordinate and the x-coordinate are subtracted.

What if a Cartesian coordinate is negative, for example (−1, −2)?
y − −2 = ...(x − −1)
Remember, that subtracting a negative number is the same as adding the positive number:
y + 2 = ...(x + 1)
Help Us To Improve Mathematics Monster

  • Do you disagree with something on this page?
  • Did you spot a typo?
Please tell us using this form

See Also

What is a linear equation? What are Cartesian coordinates? What is the x-coordinate? What is the y-coordinate? What is a linear equation in slope-point form? What is a negative number?