Skip to main content

Slope Intercept Form Calculator

Blake Boege
Written by Blake Boege · Founder, Calculator Answers

A slope intercept form calculator is an algebraic tool that determines the equation of a line in the standard form y equals mx plus b, where m represents the slope and b represents the y-intercept. The calculator computes the equation from various inputs, including two coordinate points, one point and the slope, or by converting a general linear equation. It outputs the slope, the y-intercept and the assembled equation, and displays the step-by-step working. Math students use this tool to verify coordinate geometry homework and graph lines.

Pick a starting point (two points, slope-plus-point, or standard form). Enter the values; the calculator returns y = mx + b along with the slope, y-intercept, and a worked step.

Quick Answer

Find the slope-intercept form equation of a line. Enter two points, a slope and a point, or the A, B and C of a standard-form equation to get the slope (m) and y-intercept (b).

From

For just the slope between two points, use the slope calculator. To build y − y₁ = m(x − x₁), use the point-slope form calculator.

Slope-intercept

Equation

y = 3x - 1

m = 3; b = -1

Slope m3
y-intercept b-1
Stepm = (y₂ − y₁) / (x₂ − x₁) = (8 − 2) / (3 − 1) = 3; b = y₁ − m·x₁ = 2 − 3·1 = -1

Slope-intercept form makes the y-intercept visible at a glance: it is the constant term. The slope is the coefficient of x. A vertical line cannot be written in this form because its slope is undefined.

Was this helpful?

Examples

Two points (1,2), (3,8)

m = 3, b = −1, y = 3x − 1

Slope 3, point (1,4)

b = 1, y = 3x + 1

Standard 2x + 3y = 12

m = −2/3, b = 4, y = −0.6667x + 4

Two points (0,5), (2,5)

Horizontal line y = 5

How it works

Formula · y = mx + b · m = (y₂ − y₁) / (x₂ − x₁) · b = y − m·x · from Ax + By = C: m = −A/B, b = C/B

All three input modes lead to the same equation y = mx + b. Once you have the slope (or it is given), find b by plugging a known point into the equation and solving.

Slope · m = (y₂ − y₁) / (x₂ − x₁)

Intercept · b = y − m·x

From standard form · y = (−A/B)·x + (C/B)

What this page is for, and the two beside it

Three pages on this site work on straight lines, and they are not the same page three times. The split is worth a moment before you pick one.

This page builds the equation. The subject is y = mx + b itself, and it is the only one of the three that will take a standard-form equation, Ax + By = C, and rearrange it for you. If what you have is a textbook equation in the wrong shape, this is the page.

The slope calculator is about the slope itself. The slope calculator solves from five directions rather than three, so it can recover a missing coordinate from a known slope, and it reports the angle in degrees, the grade as a percentage and the rise-run ratio. It draws the rise and run on a coordinate plane. Go there when how steep is the question and the equation is incidental.

The y = mx + b calculator explores a line you already have. The y = mx + b calculator graphs the line, reports the x-intercept as well as the y, and lets you query points along it. Go there when you want to see the line rather than write it.

Reading y = mx + b

Two letters carry the whole line. m is the slope: how much y changes for every one that x changes. Positive rises left to right, negative falls, and zero is flat. b is the y-intercept: the value of y when x is zero, which is where the line crosses the vertical axis.

That is why this form is the one people graph by hand. Put a dot at b on the y-axis, then move one step right and m steps up, and you have a second point. Everything else about the line follows from those two numbers.

Working it out by hand

Three starting points, three short routes to the same place. All three run in the tool above and produce the figures below.

1. From two points

Take (1, 2) and (3, 8). The slope is the rise over the run: m = (8 − 2) ÷ (3 − 1) = 6 ÷ 2 = 3. Now put one of the points back into y = mx + b and solve for b: 2 = 3 × 1 + b, so b = 2 − 3 = −1. The equation is y = 3x - 1. Either point works: the second gives 8 = 3 × 3 + b, and b is −1 again.

2. From a slope and one point

With m already known there is only one step. For m = 3 through (1, 4): b = y − m·x = 4 − 3 × 1 = 1, giving y = 3x + 1. Note this is the same slope as the first example but a different line, one unit higher, because b moved.

3. From standard form

This is the mode the other two pages do not have. Take 2x + 3y = 12 and solve for y. Subtract 2x: 3y = −2x + 12. Divide everything by 3: y = (−2/3)x + 4. So the slope is −2/3 and the intercept is 4. The calculator shows the slope as -0.6667, which is that fraction rounded for display. In general m = −A/B and b = C/B, which is why B cannot be zero.

A vertical line has no slope-intercept form

This is the honest limit of the form, and it is not a limitation of the calculator. y = mx + b assumes that every x has exactly one y. A vertical line has a single x and every y at once, so no equation of that shape can describe it, whatever you put in for m and b.

The slope is the reason. Slope is rise divided by run, and on a vertical line the run is zero. Dividing by zero has no answer, so the slope is undefined rather than large. There is no number to put in the m slot. Such a line is written x = 4, which is a perfectly good equation and simply not this one: it has no m and no b to report.

The tool says so rather than printing something plausible. Enter two points with the same x and it refuses and explains why, and the same happens in standard-form mode when B is zero, because Ax = C is that same vertical line wearing different clothes.

Undefined slope and zero slope are opposites

These two get swapped constantly, and they are as far apart as two cases can be. A horizontal line has a slope of exactly zero: no rise over any run. It has a completely ordinary equation, y = 5, which is y = mx + b with m set to zero. The calculator handles it without complaint.

A vertical line has an undefined slope, which is not a value at all, and no equation in this form. Zero is a number; undefined is the absence of one. Recording a vertical line as slope zero, or calling an undefined slope infinite, are two versions of the same mistake.

Edge cases

  • The same point twice is not a line. Infinitely many lines pass through one point, so there is nothing to solve. The tool reports this separately from the vertical case, because they are different situations that happen to share a zero.
  • A vertical line is refused, not approximated. No very large slope is substituted for the undefined one.
  • B = 0 in standard form is the vertical case again. Ax + 0y = C is Ax = C, a vertical line, so it is refused for the same reason rather than by dividing by zero.
  • A horizontal line is fine. Two points with the same y give m = 0 and the equation y = b, which the tool prints without the x term rather than showing a pointless 0x.
  • Slopes are shown as decimals. A slope of −2/3 displays as −0.6667, rounded to four places. The exact value is the fraction, and for written work the fraction is usually the better form.
  • A blank field waits. Clearing an input leaves the result waiting rather than treating the blank as zero and building an equation from it.

Your coordinates stay in the page

The values you enter are processed by this page in your browser. They are not sent to a server, not stored after you close the tab, and not visible to anyone else. There is no account and nothing to sign up for.

Related calculators

Sources

There is no citation on this page, and adding one would be decoration. Solving y = mx + b for b is one subtraction, and rearranging Ax + By = C is one more. These are steps of elementary algebra rather than results anybody established, and the page shows the working instead of pointing at an authority for it.

The same call was made on the percentage, final grade and circumference pages: cite what an outside body actually settles, and say plainly when nothing does.

Frequently asked questions

y = mx + b. m is the slope (rise over run), b is the y-intercept (the y value where the line crosses the y-axis). This form is the easiest to graph by hand.

First compute the slope m = (y₂ − y₁) / (x₂ − x₁). Then plug one of the points into y = mx + b and solve for b: b = y − m·x. The calculator does both steps.

Solve for y: subtract Ax from both sides to get By = −Ax + C, then divide by B: y = (−A/B)·x + (C/B). The slope is −A/B and the y-intercept is C/B. Requires B ≠ 0.

A vertical line has undefined slope and cannot be written as y = mx + b. The calculator flags this case and suggests writing the line as x = constant instead.

The slope calculator returns just the slope between two points. This page builds the full equation y = mx + b including the y-intercept. Use the slope calculator when you only need m.

It is the y value where the line crosses the vertical axis, which is the same as the value of y when x is zero. That is why slope-intercept form is the quickest to graph by hand: plot b on the y-axis, then step out by the slope.

The line falls from left to right. A positive slope rises, a slope of zero is a flat horizontal line, and a vertical line has no slope at all. Only the first three can be written as y = mx + b.

No, and they are opposites. A horizontal line has a slope of exactly zero and a perfectly good equation, y = b. A vertical line has an undefined slope, because the run is zero and dividing by zero has no answer, and it has no slope-intercept form at all.

Because the form assumes every x has exactly one y. A vertical line has one x and infinitely many y values, so no equation of that shape can describe it. It is written x = constant instead, which is not a slope-intercept equation and does not have an m or a b.

The calculator says so rather than guessing. Two identical points do not determine a line; infinitely many lines pass through a single point. This is different from a vertical line, and the tool reports the two cases separately.

Move the x term across and clear any fractions. From y = 3x − 1, subtract 3x from both sides to get −3x + y = −1, then multiply through by −1 for the usual convention: 3x − y = 1. This page converts into slope-intercept rather than out of it.

They describe the same line and are useful at different moments. Point-slope, y − y₁ = m(x − x₁), is what you can write down the instant you have a slope and any point on the line. Slope-intercept is what you get after tidying that up, and it shows the y-intercept directly.

Yes, and it usually is. Converting 2x + 3y = 12 gives a slope of −2/3. The calculator shows it as a decimal, −0.6667, rounded for display; the exact value is the fraction.

Yes. Two points define exactly one line as long as they are different points and not stacked vertically above each other. If either condition fails the calculator says why rather than returning an equation.

Then there is no y term, the equation reduces to a vertical line x = C/A, and no slope-intercept form exists. The calculator refuses that case rather than dividing by zero.