Find the equation of a line given two points on it.
Last updated: June 2026 | By Patchworkr Team
Point 1 x is required.
Compute the slope from the two points, then solve for the y-intercept with b = y1 - mx1. If the x-values are equal, the line is vertical.
For (1, 2) and (3, 8), the slope is 3 and the intercept is -1.
What if x1 equals x2?
The line is vertical and there is no slope-intercept form.
Can the intercept be negative?
Yes. Negative intercepts are normal.
What if the points are identical?
There is no unique line through a single repeated point.
Does blank input count as zero?
No. Blank input is treated as missing, not zero.
Related Tools
Calculate gradient.
Calculate line intersection.
Calculate regression line.
Calculate plane intersection.
Calculate parallel lines.
Calculate perpendicular lines.