Updated
Using Equation of a line calculator
Two points give m = (y₂ − y₁)/(x₂ − x₁), then b = y₁ − mx₁. Point-and-slope mode gives b = y − mx; slope-and-intercept mode uses y = mx + b directly.
Identical points cannot define a unique line. Vertical lines return x = constant rather than dividing by zero.
A worked example
Example inputs: first x = 1, first y = 3, second x = 3, second y = 7. Line equation = y = 2x + 1.
Before you use the result
Identical points cannot define a unique line. Vertical lines return x = constant rather than dividing by zero.
Cite this page
ToolOctopus. “Equation of a line calculator.” Updated 2026-09-26. https://tooloctopus.com/equation-of-a-line-calculator.
Add an access date if your instructions require one.
Citation formatting uses citeproc-js by Frank Bennett and Citation Style Language styles. Licence and source code.
