Slope Intercept Form Calculator: y = mx + b
By FindMySum · Last reviewed
A slope intercept form calculator turns two points into the equation of the straight line through them, written as y = mx + b. That form is the most common way to write a line because it can be read and graphed directly: m is the slope, how steep the line is, and b is the y-intercept, where it crosses the y-axis.
Worked example
Find the line through (1, 2) and (3, 8).
- Slope: m = (8 − 2) ÷ (3 − 1) = 6 ÷ 2 = 3.
- Put one point and the slope into y = mx + b: 2 = 3 × 1 + b, so b = −1.
- The equation is y = 3x − 1.
Check with the other point: 3 × 3 − 1 = 8, as it should be. The line crosses the y-axis at (0, −1) and the x-axis at (1/3, 0), and in standard form it is 3x − y = 1.
When the numbers are not whole
The calculator keeps fractions exact. Through (1, 2) and (4, 6), the slope is 4/3 and b = 2/3, so the line is y = (4/3)x + 2/3 rather than y = 1.333x + 0.667, which would drift off the true line further out. If the two points have the same x-coordinate the line is vertical, x = constant, and has no slope-intercept form.
For a point and a slope instead of two points, use the point slope form calculator; for the distance and midpoint of the same two points, the distance formula calculator.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.