Equation from two points calculator guide
Two distinct points determine exactly one line. When their x-coordinates differ, the slope is the change in y divided by the change in x, and either point can then be substituted into point-slope form.
If both x-coordinates are equal, the run is zero and the slope is undefined. That case is a vertical line written x = constant, so it has no y-intercept or slope-intercept form in y = mx + b form.
How to find a line equation from two points
- Enter point one: Provide finite x1 and y1 coordinates.
- Enter point two: Provide a different coordinate pair x2 and y2.
- Calculate: Select Find line equation to compute all applicable equation forms.
- Check the line type: For a vertical line, use x = constant instead of trying to force a numeric slope.
Formula and variables
The slope measures rise over run. Substituting one point and the slope into point-slope form defines the line, which can then be rearranged into slope-intercept or standard form.
m = (y2 - y1) / (x2 - x1); y - y1 = m(x - x1)- x1, y1 — First point
- Coordinates of one point on the line.
- x2, y2 — Second point
- Coordinates of a different point on the line.
- m — Slope
- Change in y divided by change in x when the line is not vertical.
- b — Y-intercept
- The y-value where a nonvertical line crosses the y-axis.
Find the line through (2, 3) and (6, 8)
Write the equation of the unique line through the two points.
- Point 1
- (2, 3)
- Point 2
- (6, 8)
- m = (8 - 3) / (6 - 2) = 5/4
- b = 3 - (5/4)(2) = 1/2
- Substitute m and b into y = mx + b
Result: y = 1.25x + 0.5; equivalently, 5x - 4y = -2.
For each increase of 4 in x, y increases by 5.
Understanding your results
Equivalent forms
Slope-intercept form emphasizes rate and intercept, point-slope form emphasizes a known point, and standard form keeps both variables on one side.
Vertical result
An equation x = constant is complete even though its slope and y-intercept are undefined.
Assumptions
- Coordinates are finite real numbers.
- The two coordinate pairs represent distinct points.
- The intended relationship is the straight line through both points.
Limitations
- The calculator does not fit a trend line through three or more noisy observations.
- It does not reduce decimal standard-form coefficients to a preferred integer multiple.
- Floating-point inputs can produce rounded decimal display values.
- It does not determine parallel or perpendicular lines.
Common mistakes
- Reversing the subtraction order in only the numerator or denominator.
- Dividing by zero for a vertical line.
- Treating two identical points as enough information to determine one line.
- Forgetting to substitute a point when finding the y-intercept.
- Assuming every line has a y-intercept.
Practical use cases
Coordinate geometry
Write the line through two plotted points in the equation form required by an assignment.
Two-observation rate
Represent a constant rate of change when exactly two observations define the model.
Planning and decision guide
Choose the useful form
Use slope-intercept form to read rate and intercept, point-slope form when a point is central to the work, and standard form when comparing coefficients or solving a system.
Frequently asked questions
How do I find slope from two points?
Subtract the y-values in one order and divide by the x-values subtracted in the same order.
What if both x-coordinates are equal?
The line is vertical, its slope is undefined, and its equation is x equal to that shared coordinate.
Can the two points be identical?
No. Infinitely many lines pass through one point, so a second distinct point is required.
Why can equivalent standard forms look different?
Multiplying every coefficient and the constant by the same nonzero factor produces the same line.
Does the order of the points change the answer?
No. Reversing both coordinate differences changes both signs, leaving their ratio and the line unchanged.
Sources and review
- Find the Equation of a Line — OpenStax Intermediate Algebra 2e. Accessed 2026-08-29.
- Slope of a Line — OpenStax Intermediate Algebra 2e. Accessed 2026-08-29.
Reviewed 2026-08-29.