Last updated October 10, 2026 · Report an error
Any two distinct points determine exactly one straight line, and that line's equation can be found directly from their coordinates.
This calculator finds the slope-intercept equation of the line through any two given points.
How it works
Enter the coordinates of two points. The calculator computes the slope between them, then uses point-slope form to solve for the y-intercept, producing the final equation in y = mx + b form (or x = constant for a vertical line).
- Enter point 1 — x.
- Enter point 1 — y.
- Enter point 2 — x.
- Enter point 2 — y.
- Click Calculate to see your results.
Examples
(1,2) and (3,6)
The line through (1,2) and (3,6) has the equation y = 2x + 0, since the slope is 2 and the line passes through the origin.
Who should use it
- Finding the equation of a line for algebra or coordinate geometry coursework.
- Checking a hand-derived line equation from two known points.
Industry applications
- Algebra and geometry education
- Data analysis (linear trends between two data points)
Advantages
- Automatically handles the vertical-line special case instead of failing on it.
- Shows both the slope and y-intercept as separate results alongside the full equation.
Limitations
- Outputs slope-intercept form only, not standard form (Ax + By = C) or point-slope form.
Common mistakes to avoid
- Entering the same point twice, which doesn't define a unique line (division by zero in the slope formula).
- Mixing up which coordinate is x and which is y when entering the two points.
Best practices
- Verify the resulting equation by plugging both original points back in and confirming they satisfy y = mx + b.
Tips
- If you only need the rate of change between two points (not the full equation), the site's Slope Calculator gives just that value directly.