Try it with your numbers
Show every step
The whole method is two small moves: one subtraction-and-division, one substitution. Almost every lost mark comes from sign slips in the first move or from the special cases covered below, so those are worth a closer look than the routine steps.
How do you find the equation of a line from two points?
Start with the slope formula, because the slope is the only thing the line needs beyond a single anchor point. Then use that anchor point in point-slope form, and tidy the result into slope-intercept form if the problem asks for .
- Label the points and .
- Compute .
- Substitute and one point into .
- Distribute, then solve for .
Example 1. Find the line through and .
Check the point you did not use: at , . It matches, so the equation is .
One shortcut is worth keeping. Once you know , the intercept is , which saves the distribute-and-collect step. For Example 1 that gives , in a single line.
Where does the two-point formula come from?
Take any point on the line. The slope from to must equal the slope between the two given points, because a straight line has only one slope. Writing that as an equation gives the two-point form:
Multiply both sides by and you get , the point-slope form. Nothing more is hiding in there: the formula is a statement that every point on the line shares one slope.
Cross-multiplying gives a version without division: . This form never breaks, even when . It also has a compact matrix form, since three points are collinear exactly when a 3×3 determinant vanishes:
For Example 1, expanding gives . Divide by 3 and solve for , and the result is , the same line.
Quick check
Answer:
Equation of a line through two points with negative numbers

Negatives do not change the method, only the bookkeeping. Wrap every negative coordinate in parentheses before subtracting, and subtract in the same order on top and bottom.
Example 2. Find the line through and .
Check : . Correct.
You can also sanity-check the sign of the slope before doing any algebra. Moving from left to right, the y-values drop from to , so the line falls and must be negative. A positive slope here means a sign slip somewhere.
Both subtractions must start from the same point. and both give , but gives , the wrong sign.
How do you handle fractions and write standard form?
When the slope is a fraction, clear the denominator before you distribute. It keeps the arithmetic in whole numbers, and it is also exactly what standard form wants.
Example 3. Find the line through and , in slope-intercept and standard form.
For slope-intercept form, distribute and subtract 2:
For standard form, multiply the point-slope equation by 4 first:
Check both points in the standard form: and . Both work.
The usual convention is integer coefficients with positive, so if your first attempt gives , multiply through by . Both describe the same line, but many answer keys expect the positive- version.
What if the two points are vertical or horizontal?

If the two points share an x-coordinate, the slope formula divides by zero. That is not a calculation error: a vertical line has no slope, and no equation exists for it. The line is simply .
Example 4. Find the line through and . Both x-values are , so the denominator is and the line is . The cross-multiplied form agrees: reduces to , which gives .
The opposite case is gentler. Points and give , so and the line is . A zero numerator is fine; only a zero denominator breaks the formula. See horizontal and vertical lines for how these two cases look on a graph.
A two-second test before any calculation: same x means vertical, same y means horizontal. Check for it first and you will never feed a zero denominator into a calculator.
Quick check
Answer:
How do you check the equation of a line?
The strongest check uses a point the algebra did not rely on. If you built the equation with , substitute . A wrong slope or intercept almost always fails this test, since an error would have to fit both points to survive.
A few more fast checks catch different mistakes:
- The slope sign matches the picture: rising left to right means positive, falling means negative.
- If one point has , its y-value must equal .
- Both points satisfy the final equation, not just one.
When the answer still feels off, plot the points and draw the line. If it misses either point, the equation is wrong, and the position of the miss tells you whether the slope or the intercept is at fault.
Try this: Find the line through and twice, once using as and once using . Simplify both to and confirm they match.
Two-point form vs point-slope form and the distance formula
The two-point form is point-slope form with the slope already substituted in. Point-slope needs a point and a slope; two-point form needs only two points. They are the same idea at different stages.
Students also mix up the formulas that take two points as input, because several of them do:
| Formula | Input | Output |
|---|---|---|
| Slope formula | two points | steepness |
| Two-point form | two points | the full line equation |
| Distance formula | two points | length between them |
| Midpoint formula | two points | the point halfway between |
The slope formula is the first half of the line-finding method, never a replacement for it. Reading a problem for what it asks (an equation, a length or a point) picks the right formula in one glance.
For and the slope is , but the distance is . Slope measures tilt, distance measures length.
Where is the equation of a line from two points used?
Whenever two measurements are assumed to be linked at a steady rate, two data points define the model. The slope is the average rate of change, and the intercept is the starting value.
Example 5. A taxi charges 7 dollars for a 2 mile ride and 15 dollars for a 6 mile ride. Treat and as points .
The model is : a 3 dollar base fee plus 2 dollars per mile. A 10 mile ride predicts dollars.
The same method converts temperatures. Water freezes at and boils at in (Celsius, Fahrenheit), so and . If the line passes through the origin, and the model is a direct variation .
Predicting between your two points (interpolation) is generally safe. Predicting far outside them (extrapolation) assumes the straight-line pattern continues, which real situations often break.
Quick check
Answer:
How do you find a perpendicular bisector from two points?
A perpendicular bisector combines three skills: the midpoint formula, the slope formula, and the rule for perpendicular slopes, which are negative reciprocals. The line passes through the midpoint of the segment, with slope perpendicular to the segment itself.
Example 6. Find the perpendicular bisector of the segment from to .
Check that the midpoint is on the line: . Every point on this line is equally far from and , which is why it appears in geometry constructions and in problems about the point closest to two locations.
Practice problems
0 of 5 solved
- Find the equation of the line through and .
Answer:
Slope: . The point sits on the y-axis, so with no further work. The line is . - Find the equation of the line through and in slope-intercept form.
Answer:
Slope: . Point-slope with : . Distribute and add 6: . Check : . - Find the equation of the line through and .
Answer:
Slope: . Point-slope with : . Distribute: . Check : . - Write the line through and in standard form with integer coefficients and .
Answer:
Slope: . Point-slope: . Multiply by 3: . Rearrange: . Check : . - Find the equation of the perpendicular bisector of the segment with endpoints and .
Answer:
Midpoint: . Segment slope: , so the perpendicular slope is . Point-slope: . Simplify: .
Common questions
What is the formula for the equation of a line through two points?
Find the slope with , then write using either point. Simplify to if you want slope-intercept form.
Does it matter which point you use as ?
No. Both choices give the same line, because both points satisfy the final equation. Pick the point with the friendlier numbers, or the one with , which hands you the y-intercept directly.
What is the equation of a line if the two points have the same x-coordinate?
The line is vertical and its equation is , where is the shared x-value. The slope formula gives a zero denominator, so the slope is undefined and does not apply.
How do you find the equation of a line from two points in standard form?
Find the equation in point-slope or slope-intercept form first. Then clear any fractions and move the term to the left so you get , usually with positive and all coefficients integers.
How do you find the equation of a line from two points on a graph?
Read the coordinates of two points where the line crosses grid intersections exactly, then apply the slope formula and point-slope form. Points far apart reduce reading errors.
Can two points give more than one line?
No. Two distinct points determine exactly one straight line. The slope is fixed by the two points, and one point then fixes the intercept.