Line Equation from Two Points Calculator
This line equation from two points calculator will help you write down the equation of a line passing through any pair of points. Scroll down to find an article explaining how to determine the slopeintercept linear equation as well as the standard form linear equation from any two points in 2D space. We will also teach you how to find the 3D line equation from two points!
Of course, we provide all the formulas in case you have to solve such a problem by hand. In such a case, don't forget to check your solution with Omni's line equation from two points calculator!
🙋 Check out our slope intercept form calculator if you're not yet familiar with this type of equation.
What is the linear equation from two points?
The linear equation from two points (x_{1}, y_{1}) and (x_{2}, y_{2}) describes the unique line that passes through these points. This equation can be in the standard form (Ax + By + C = 0) or in the slopeintercept form (y = ax + b). A unique line equation also exists for any two points in threedimensional space.
In what follows, we discuss how to determine the line equation from two points — first in the slopeintercept form and then in the standard form. Then we will move on to 3D space.
How do I find the slopeintercept line equation from two points?
To compute the equation of the line passing through points (x_{1}, y_{1}) and (x_{2}, y_{2}):
 Compute the slope as a = (y_{2}y_{1}) / (x_{2}x_{1}).
 Compute the intercept as b = y_{1}  a × x_{1}.
 The equation you need reads y = a × x + b, with a an b computed as above.
 If x_{2} = x_{1}, you cannot compute a — the line is vertical and has equation x = x_{1}.
💡 Does the slope formula from Step 1 remind you of the rise over run formula? This is not an accident! Discover more with our rise over run calculator.
How do I compute the standard form linear equation from two points?
To compute the standard form equation of the line passing through (x_{1}, y_{1}) and (x_{2}, y_{2}):
 Compute A = y_{2}  y_{1}.
 Compute B = x_{1}  x_{2}.
 Finally, compute C = y_{1} × (x_{2}  x_{1})  (y_{2}  y_{1}) × x_{1}.
 The standard form linear equation from two points is Ax + By + C = 0 with A, B, and C as above.
3D line equation from two points
The equation of the line passing through points (x_{1}, y_{1}, z_{1}) and (x_{2}, y_{2}, z_{2}) is:
(x, y, z) = v × t + point
where:
 v – Directional vector computed as v = [x_{2}x_{1}, y_{2}y_{1}, z_{2}z_{1}];
 t – A real parameter; and
 point – One of the two points we're given.
See our direction of the vector calculator for more information on v here.
Explicitly, the 3D line equation from two points reads:
(x, y, z) = [x_{2}x_{1}, y_{2}y_{1}, z_{2}z_{1}] × t + (x_{1}, y_{1}, z_{1})
We can rewrite this as the system of equations for each coordinate:
x = (x_{2}  x_{1}) × t + x_{1}
y = (y_{2}  y_{1}) × t + y_{1}
z = (z_{2}  z_{1}) × t + z_{1}
How to use this line equation from two points calculator?
Omni's line equation from two points calculator is really straightforward to use! Follow these steps:

First, tell us what dimension your problem sits in: 2D or 3D.

Enter the coefficients of the points in respective fields.

Our tool determines the linear equation immediately and displays it at the bottom of the calculator:

For 2D problems: it shows the slopeintercept equation and standard form equation.

For 3D problems: it shows the parametric equation, both in vector form and as a system of equations.


You can adjust the precision of calculations by clicking the
advanced mode
and changing the value of the variable Precision.
FAQ
What is the two point form formula?
Two point form formula is a way of writing down the equation of a line passing through two points. If the points are (x_{1}, y_{1}) and (x_{2}, y_{2}), then the twopoint form reads:
y  y_{1} = (y_{2}  y_{1})/(x_{2}  x_{1}) × (x  x_{1}).
What is the equation of a line passing through (1,1) and (3,5)?
This equation is y = 2x  1. To arrive at this answer, we find the slope as follows:
a = (y_{2}  y_{1}) / (x_{2}  x_{1}) = (51) / (31) = 4/2 = 2
Then we find the intercept as b = y_{1}  a × x_{1} = 1  2 × 1 = 1. So the equation reads y = a × x + b = 2x  1, as claimed.