Line Equation from Two Points Calculator
Enter two distinct points to calculate slope and a line equation.
A QUICK WALKTHROUGH
How to use this tool
- Enter x and y coordinates for point one.
- Enter x and y coordinates for point two.
- Review slope and equation; vertical lines are shown as x = constant.
Formula and scope
For distinct points, slope m = (y₂−y₁)/(x₂−x₁). If x₁ = x₂, the line is vertical and is written x = x₁. Otherwise y-intercept b = y₁−mx₁ and equation is y = mx+b.
Coordinate geometry
Coordinates must use the same Cartesian coordinate system. Local calculation only.
GOOD TO KNOW
Common questions
What if the x coordinates match?
The line is vertical; slope is undefined and the equation is x = that shared coordinate.