Line Equation from Two Points
Enter any two distinct points to calculate slope, slope-intercept form, point-slope form, standard form, midpoint, and distance.
What a line equations calculator does
A line equations calculator quickly finds the equation of a straight line based on input values. The most common use case is entering two points, then getting back every major representation of the same line. This saves time, reduces algebra errors, and helps students check homework step by step.
With this calculator, you enter two points (x₁, y₁) and (x₂, y₂). The tool then computes:
- Slope m
- Slope-intercept form y = mx + b (when possible)
- Point-slope form
- Standard form Ax + By = C
- Midpoint and distance between the two points
Core formulas behind the calculator
1) Slope formula
The slope measures rise over run:
m = (y₂ - y₁) / (x₂ - x₁)
If x₂ - x₁ = 0, the line is vertical and slope is undefined.
2) Slope-intercept form
When the line is not vertical, it can be written as:
y = mx + b
After finding m, substitute one point to compute b.
3) Point-slope form
This form is useful right after slope calculation:
y - y₁ = m(x - x₁)
It always works for non-vertical lines and is excellent for manual algebra checks.
4) Standard form
A line can also be written as:
Ax + By = C
Standard form is common in graphing and systems of equations.
How to use this calculator correctly
- Enter the first point in x₁ and y₁.
- Enter the second point in x₂ and y₂.
- Click Calculate.
- Read each equivalent line form in the result panel.
Tip: if you accidentally reverse points, use Swap Points. The equation remains equivalent, but this helps with quick checking.
Special cases to understand
Vertical lines
When both x-values are identical, the line is vertical. The equation is x = constant. There is no slope-intercept form because slope is undefined.
Horizontal lines
When both y-values are identical, slope is 0. The equation simplifies to y = constant.
Identical points
If both points are exactly the same, infinitely many lines pass through that single point. A unique line equation cannot be determined.
Practice examples
Example A
Points: (1, 3) and (5, 11)
- Slope: (11 - 3) / (5 - 1) = 8/4 = 2
- Equation: y = 2x + 1
Example B
Points: (4, -2) and (4, 7)
- Same x-value, so line is vertical
- Equation: x = 4
Why this matters beyond algebra class
Line equations are used in statistics, economics, engineering, coding, physics, and data analysis. Whenever you model a constant rate of change, you are using linear relationships. A fast line equation calculator helps you move from raw points to useful decision-making formulas in seconds.