Slope-intercept form writes a line as y = mx + b, where m is the slope and b is the height at which the line crosses the y-axis. It is the form you can sketch from without thinking: mark b on the y-axis, step one across and m up, and draw through. The case worth understanding first is the one this ...
A vertical line has no slope-intercept form. There is no m that works for x = 3, because the line never settles on one y for a given x — and undefined is not the same as infinite, nor the same as zero. A horizontal line has slope zero and a perfectly good form. The two are perpendicular to each other and get swapped constantly. Of all pairs of distinct lattice points on a small grid, 5.6% give a vertical line, exactly as many as give a horizontal one. This page tells you which you have rather than printing an equation with a broken number in it.
Whole numbers, decimals and fractions such as 3/4 all work.
X₁
Y₁
X₂
Y₂
SLOPE-INTERCEPT FORM
y = 2x + 1
Slope 2, crossing the y-axis at 1. Substituting the given points back reproduces them exactly.
| Slope-intercept | y = 2x + 1 |
| Point-slope | y − 1 = 2x |
| Standard | 2x − y = −1 |
EACH GIVEN POINT PUT BACK IN
(0, 1) → y = 1 ✓
(2, 5) → y = 5 ✓
SLOPE
2
a whole number, unusually
Y-INTERCEPT
1
where the line crosses the y-axis
X-INTERCEPT
−1/2
where the line crosses the x-axis
PERPENDICULAR SLOPE
−1/2
the negative reciprocal of this slope
WHAT IS HAPPENING
m = (5 − 1) ÷ (2 − 0) = 4 ÷ 2
The change in y divided by the change in x. Taking the points in the other order flips both signs, so the slope comes out the same either way — which is worth knowing, because it means the order cannot be the source of a wrong answer.
1 = 2(0) + b, so b = 1
Either point works and both give the same b — using the second is a free check on the first. b is where the line crosses the y-axis, which is what makes this form quick to sketch from.
y = 2x + 1
Slope and intercept, both exact. A slope kept as a fraction is the line through your points; the same slope rounded to a decimal is a line very slightly beside it.
Why vertical is the odd one out. Slope-intercept singles out y and asks what it equals for each x. A vertical line has every y at one x, so the question has no answer and the form has nothing to say. Standard form, Ax + By = C, treats the two variables alike and handles every line without exception — which is the reason it survives alongside a form that is easier to read.
Exact fractions throughout · every given point is substituted back into the equation found
Choose how you are starting: from two points, from a slope and a point, or from standard form Ax + By = C. All three arrive at the same place and the working differs.
Enter the values. Whole numbers, decimals and fractions such as 3/4 all work, and the slope stays a fraction rather than becoming a rounded decimal.
Read the result. If the line is vertical the page says so plainly and gives x = a constant instead of inventing a slope; every other line gets all three forms.
Check the substitution panel. Each point you supplied is put back into the equation found, and what it produces is shown rather than assumed.
Take the line through (0, 1) and (2, 5). The slope is the rise over the run: (5 − 1) ÷ (2 − 0) = 4 ÷ 2 = 2. Taking the points the other way round gives (1 − 5) ÷ (0 − 2), which is −4 ÷ −2, the same 2 — so the order cannot be the source of a wrong answer. Now find b by putting a point back in: 1 = 2(0) + b, so b = 1. The line is y = 2x + 1. Using the other point as a check, 5 = 2(2) + 1 = 5, which holds. Now the line through (1, 1) and (4, 3). The slope is (3 − 1) ÷ (4 − 1) = 2/3. Then 1 = (2/3)(1) + b gives b = 1/3, so y = (2/3)x + 1/3. Neither number is whole, and that is normal rather than a sign of a mistake: among lattice-point pairs with a slope, 69.1% of the slopes are fractions. Written as 0.667 and 0.333 this is a line very slightly beside the one through your two points. Now the line through (3, 1) and (3, 9). The run is 3 − 3 = 0. This is not a very steep line or a very large slope — the division has no answer, and the line is vertical. Its equation is x = 3, and it has no slope-intercept form. It does still have an x-intercept, at 3, and its perpendicular is horizontal with slope 0. Compare that with the line through (1, 4) and (7, 4). Here the rise is zero, not the run, so the slope is 0 ÷ 6 = 0. The line is y = 4, which is a perfectly good slope-intercept form. This one never reaches the x-axis, so it has no x-intercept, and its perpendicular is the vertical case. The two lines are perpendicular to each other and exactly one of them can be written as y = mx + b. Finally, from standard form: x + 2y = 4. Subtract x and divide by 2 to get y = −(1/2)x + 2. The general rule is m = −A ÷ B and b = C ÷ B, which is also a proof of the vertical case — when B is zero there is nothing to divide by, and that is the method correctly reporting that no such form exists.
| Rule | What it says | Why |
|---|---|---|
| Slope-intercept form | y = mx + b | m is the slope, b is where the line crosses the y-axis. |
| Slope from two points | m = (y₂ − y₁) ÷ (x₂ − x₁) | Rise over run. Taking the points in either order gives the same answer. |
| Vertical lines | x = a constant | No slope, and no slope-intercept form at all. Not an infinite slope — none. |
| Horizontal lines | y = a constant | Slope zero, which is an ordinary number with an ordinary form. |
| Zero is not undefined | they are perpendicular | Horizontal has slope 0; vertical has no slope. Swapping them is the usual error. |
| Point-slope form | y − y₁ = m(x − x₁) | Writable straight from a slope and a point, with no arithmetic. |
| Standard form | Ax + By = C | Treats x and y alike, so it can describe vertical lines too. |
| Standard to slope-intercept | m = −A ÷ B, b = C ÷ B | Which fails exactly when B is zero — the vertical case. |
| Finding b | b = y₁ − m·x₁ | Substitute any point on the line. Both points give the same b. |
| Parallel lines | the same m | Different b. Same steepness, never meeting. |
| Perpendicular lines | m₁ × m₂ = −1 | The negative reciprocal. A whole-number slope gives a fractional one. |
| The x-intercept | x = −b ÷ m | Undefined for a horizontal line, which never reaches the x-axis. |
| Slopes are usually fractions | 69.1% of lattice pairs | A slope rounded to a decimal is a slightly different line. |
| Sketching from the form | mark b, then step m | Start at (0, b), go one right and m up, and draw through. |
m is the slope — how much y changes for each step of one in x — and b is the y-intercept, the height at which the line crosses the y-axis. Together they fix the line completely. The form is popular because it can be sketched without arithmetic: put a dot at (0, b), move one right and m up, and draw the line through the two points.
24 Times Table
Calculate instantly →
Quadratic Equation Solver
Calculate instantly →
Logarithm Calculator
Calculate instantly →
Fraction Calculator
Calculate instantly →
Fraction Simplifier
Calculate instantly →
Linear Equation Solver
Calculate instantly →
25 Times Table
Calculate instantly →
26 Times Table
Calculate instantly →
27 Times Table
Calculate instantly →
Simultaneous Equations Solver (2×2)
Calculate instantly →
28 Times Table
Calculate instantly →
Exponent Calculator
Calculate instantly →
29 Times Table
Calculate instantly →
30 Times Table
Calculate instantly →
Times Tables Mega Calculator
Calculate instantly →
Square Root of 10
Calculate instantly →
Square Root of 1
Calculate instantly →
Square Root Mega
Calculate instantly →
Square Root of 2
Calculate instantly →
23 Times Table
Calculate instantly →
Last updated: August 5, 2026 · Exact fractions throughout, never floating point · A vertical line has no slope, which is not the same as a slope of zero.