Line Equation Calculator (Using Two Points)
Enter two points on a line to calculate the equation, slope, intercepts, midpoint, and distance between points.
What is an equation calculator with points?
An equation calculator with points helps you find the equation of a line when you know coordinates on that line.
In plain terms, if you can identify two points like (x₁, y₁) and (x₂, y₂), you can define exactly one straight line
(as long as the points are different).
This tool automates the algebra so you can focus on understanding the result. It gives you multiple forms of the line equation, not just one: slope-intercept form, point-slope form, and standard form. It also reports midpoint and distance, which are useful in geometry, analytics, and modeling.
How to use this calculator
Step-by-step
- Enter the first point values for
x₁andy₁. - Enter the second point values for
x₂andy₂. - (Optional) Enter an
xvalue to compute the matchingy. - Click Calculate Equation.
If the line is vertical (both points have the same x-value), the slope is undefined and the equation is shown as x = constant.
The calculator handles this automatically.
The math behind the results
1) Slope
The slope tells you how much y changes for every 1-unit change in x:
m = (y₂ - y₁) / (x₂ - x₁).
2) Slope-intercept form
Once slope is known, the equation can be written as:
y = mx + b, where b is the y-intercept.
3) Point-slope form
A very direct representation using one known point is:
y - y₁ = m(x - x₁).
This form is often easiest when building equations from coordinate data.
4) Standard form
Many classrooms and technical contexts prefer:
Ax + By = C.
This calculator provides that form too.
Special cases you should know
- Vertical line:
x₁ = x₂. Slope is undefined; equation isx = x₁. - Horizontal line:
y₁ = y₂. Slope is 0; equation isy = constant. - Identical points: If both points are exactly the same, no unique line exists.
Worked example
Suppose your points are (2, 5) and (6, 13). Then:
m = (13 - 5) / (6 - 2) = 8/4 = 2- Using
y = mx + b:5 = 2(2) + b, sob = 1 - The line is
y = 2x + 1
If you then plug in x = 10, the output is y = 21.
Where this is useful
- Graphing and coordinate geometry homework
- Quick checks in physics and engineering labs
- Data trend baselines for business reporting
- Programming and game development path calculations
Quick FAQ
Can I use decimals and negative values?
Yes. The calculator accepts integers, decimals, and negative numbers.
Does it show undefined slope correctly?
Yes. Vertical lines are detected and displayed with the equation x = constant.
Why show multiple equation forms?
Different teachers, textbooks, and software prefer different forms. Seeing all forms helps with understanding and conversion.