Slope Intercept Form Calculator

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.

THE TWO POINTS

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-intercepty = 2x + 1
Point-slopey − 1 = 2x
Standard2x − 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

1Start with the rise over the run

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.

2Put one point back in to find b

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.

3Write it out

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.

THE LINEthe shaded step is one run across and the matching rise up, which is the slope−3.34.86.5−1.5runrisethe filled dot is the y-intercept at 1, the open one the x-intercept at −0.5

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.

PARALLEL AND PERPENDICULARparallel keeps the slope and moves the intercept · perpendicular turns it into its negative reciprocal−3.34.86.5−1.5the line, slope 2parallel, same slopeperpendicular, slope −1/2

Exact fractions throughout · every given point is substituted back into the equation found

Created with❤️byeaglecalculator.com

HOW TO USE

  1. 1

    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.

  2. 2

    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.

  3. 3

    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.

  4. 4

    Check the substitution panel. Each point you supplied is put back into the equation found, and what it produces is shown rather than assumed.

WORKED EXAMPLE

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.

REFERENCE RULES

RuleWhat it saysWhy
Slope-intercept formy = mx + bm is the slope, b is where the line crosses the y-axis.
Slope from two pointsm = (y₂ − y₁) ÷ (x₂ − x₁)Rise over run. Taking the points in either order gives the same answer.
Vertical linesx = a constantNo slope, and no slope-intercept form at all. Not an infinite slope — none.
Horizontal linesy = a constantSlope zero, which is an ordinary number with an ordinary form.
Zero is not undefinedthey are perpendicularHorizontal has slope 0; vertical has no slope. Swapping them is the usual error.
Point-slope formy − y₁ = m(x − x₁)Writable straight from a slope and a point, with no arithmetic.
Standard formAx + By = CTreats x and y alike, so it can describe vertical lines too.
Standard to slope-interceptm = −A ÷ B, b = C ÷ BWhich fails exactly when B is zero — the vertical case.
Finding bb = y₁ − m·x₁Substitute any point on the line. Both points give the same b.
Parallel linesthe same mDifferent b. Same steepness, never meeting.
Perpendicular linesm₁ × m₂ = −1The negative reciprocal. A whole-number slope gives a fractional one.
The x-interceptx = −b ÷ mUndefined for a horizontal line, which never reaches the x-axis.
Slopes are usually fractions69.1% of lattice pairsA slope rounded to a decimal is a slightly different line.
Sketching from the formmark b, then step mStart at (0, b), go one right and m up, and draw through.

FREQUENTLY ASKED QUESTIONS

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.

  • ·m is the change in y for each step of one in x
  • ·b is the height where the line crosses the y-axis
  • ·The two together fix the line completely
  • ·Sketch it by marking b and stepping m

RELATED CALCULATORS

MORE ALGEBRA CALCULATORS

Was this calculator helpful?

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.