Linear Equation Calculator
Find the equation of the straight line through two points: slope, y-intercept, slope-intercept and standard forms, plus the x-intercept.
The slope is the rize over the run, m = (y₂ − y₁) ÷ (x₂ − x₁).
How the linear equation calculator works
The slope is the rize over the run, m = (y₂ − y₁) ÷ (x₂ − x₁). Substituting one point into y = mx + b gives the intercept b = y₁ − m x₁. A vertical line (x₁ = x₂) has no slope and is written x = constant.
Formula: m = (y₂ − y₁) / (x₂ − x₁); y = mx + b; b = y₁ − m x₁
Worked examples
| Inputs | Equation | Note |
|---|---|---|
| (1, 2) and (4, 8) | y = 2x | y = 2x + 0 |
| (0, 3) and (6, 0) | y = -0.5x + 3 | y = −0.5x + 3 |
| (2, 5) and (2, 9) | x = 2 | vertical: x = 2 |
FAQFrequently asked questions
What is slope?
How much y changes for each unit of x: rize ÷ run. A slope of 2 rises 2 for every 1 across; negative slopes fall.
What is the y-intercept?
Where the line crosses the y-axis — the value of y when x = 0.
How do I write the line in standard form?
Ax + By = C with A, B, C usually integers; the calculator shows −mx + y = b.
What are parallel and perpendicular slopes?
Parallel lines share a slope; perpendicular slopes multiply to −1 (2 and −½).
What if the two points have the same x?
The line is vertical, x = constant, and has no slope.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- Common Core State Standards — Mathematics — the terms and methods taught in US schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.