Give this calculator two points, a slope plus one point, or a slope plus a y-intercept, and it builds the line's equation in slope-intercept form y = mx + b, along with the slope, y-intercept, x-intercept, and a second point on the line.
How the y = mx + b calculator works
Slope-intercept form is the friendliest way to write a line: y = mx + b says "start at height b on the y-axis, then rise m for every step right." Any non-vertical line can be written this way, and only two facts are ever needed to pin it down. This calculator accepts those two facts in whichever form you have them (two points, a slope and a point, or the slope and intercept directly) and hands back the finished equation plus everything it implies: both intercepts and a second point for graphing.
The formulas
m = (y₂ − y₁) ÷ (x₂ − x₁)
b = y − m·x (using any known point)
x-intercept: x = −b ÷ m
m is the slope, b is the y-intercept, and (x, y) is any point known to be on the line. Whichever mode you use, the calculator finds m first (or takes yours), then back-solves b, then reads everything else off the finished equation.
Worked example
Find the line through (1, 3) and (3, 7):
m = (7 − 3) ÷ (3 − 1) = 4 ÷ 2 = 2
b = 3 − 2×1 = 1, so the equation is y = 2x + 1.
Setting y = 0 gives the x-intercept: x = −1 ÷ 2 = −0.5. The line crosses the axes at (0, 1) and (−0.5, 0) and climbs two units for every one it moves right.
Reading an equation like a native
Once m and b are second nature, an equation stops being symbols and becomes a picture. y = 3 is a flat line at height 3 (m = 0, so the x term vanishes). y = x is the perfect 45° diagonal (m = 1, b = 0, both invisible in the notation, which trips people up). y = −2x falls steeply through the origin. The one line the form can't express is a vertical one like x = 2: its slope would be division by zero, so it gets written as x = a instead, with no y in sight. If you feed this calculator two points stacked vertically, it won't pretend otherwise; it tells you the slope is undefined and gives you the x = a equation instead.
Frequently asked questions
What do m and b stand for in y = mx + b?
m is the slope (how much y changes for every 1-unit increase in x) and b is the y-intercept, the value of y where the line crosses the y-axis (at x = 0). Together they pin down exactly one line: b tells you where to start, m tells you how steeply to tilt.
How do I find b if I know the slope and one point?
Plug the point into b = y − m·x. If the slope is 2 and the line passes through (1, 3), then b = 3 − 2×1 = 1, so the equation is y = 2x + 1. Any point on the line gives the same b, so use whichever one you have.
How do I find the equation of a line from two points?
Two steps: first find the slope m = (y₂ − y₁) ÷ (x₂ − x₁), then plug either point into b = y − m·x to get the y-intercept. This calculator does both and formats the finished equation for you.
What are the equations of horizontal and vertical lines?
A horizontal line has slope 0, so it's simply y = b, for example y = 3. A vertical line can't be written as y = mx + b at all: its slope is undefined because the run is zero, so it's written as x = a instead, like x = 2. If you enter two points with the same x, this calculator tells you exactly that.
How do I find the x-intercept from y = mx + b?
Set y to 0 and solve: 0 = mx + b gives x = −b ÷ m. For y = 2x + 1 that's x = −0.5, so the line crosses the x-axis at (−0.5, 0). Horizontal lines (m = 0) never cross the x-axis unless b is also 0, in which case the line is the x-axis.