Slope-Intercept Form Calculator

Put a line into y = mx + b. Paste a linear equation in several common forms and it will be rearranged step by step — or build the equation from a slope and intercept, or from two points.

Any linear equation in x and y. Coefficients can be whole numbers, decimals or fractions, and one set of brackets is allowed — so point-slope form works too.

What slope-intercept form tells you

y = mx + b

m is the slope and b is where the line crosses the y-axis. Those two numbers are everything you need to draw it: start at (0, b), then move one step right and m units vertically. That is why this form is useful for graphing.

Finding the equation of a line from two points

This is a common version of the question, and it takes two steps: find the slope, then find where the line crosses the y-axis.

  1. Slope. m = (y₂ − y₁) ÷ (x₂ − x₁) — the change in y divided by the change in x.
  2. Intercept. b = y₁ − m × x₁, using either point. Both give the same answer, which is a useful check.

Example. For (1, 2) and (4, 3): the slope is (3 − 2) ÷ (4 − 1) = 1/3. Then b = 2 − (1/3)(1) = 5/3, so the line is y = (1/3)x + 5/3. Using the second point instead: b = 3 − (1/3)(4) = 5/3, the same.

The two points tab above does this and shows both steps, along with the same line written in point-slope and standard form.

Two points with the same x-value are the exception: that line is vertical, has no slope, and cannot be written as y = mx + b at all. Its equation is x = c where c is the shared x-value.

Rearranging an equation into this form

The work is always the same: collect the x and y terms, get the y term alone on one side, then divide by its coefficient.

For 2x + 3y = 6: subtract 2x from both sides to get 3y = −2x + 6, then divide everything by 3, giving y = (−2/3)x + 2. The slope is −2/3 and the line crosses the y-axis at 2.

The step people most often miss is dividing every term by the coefficient, not just the x term. Dividing 3y = −2x + 6 by 3 has to change the 6 as well.

What this calculator will read

  • Standard form — 2x + 3y = 6, -2x + 5y = 10
  • Point-slope form — y - 3 = 2(x - 1)
  • Already solved — y = 4x - 5, which it will simply confirm
  • Terms on both sides — 3x + 2 = y - x
  • Fractions and decimals — 2/3x + y = 4, 0.5x + 1.5y = 3
  • Vertical lines — 3x = 9, which it will tell you has no slope-intercept form

The cases that aren’t lines

Some equations look linear and describe no line at all, and a calculator that returns m = 0, b = 0 for them is hiding the answer rather than giving it.

  • Vertical lines such as 3x = 9 have no slope, so no y = mx + b exists. The equation is x = 3 and nothing else.
  • Identities such as x + y = x + y are true for every point on the plane. That is not a line.
  • Contradictions such as x + 1 = x + 5 are true for no point at all, so there is nothing to draw.

Why fractions instead of decimals

The slope of 2x + 3y = 6 is exactly −2/3. Rounded to −0.67 it is a different number, and the error carries into anything you calculate afterwards. This calculator keeps calculated values exact, displaying fractions instead of rounding them to decimals.

Frequently asked questions

How do I convert standard form to slope-intercept form?

Move the x term to the other side, then divide every term by the coefficient of y. For Ax + By = C the result is y = (−A/B)x + C/B. Dividing every term — including the constant — is the step most often missed.

How do I find the equation of a line with two points?

Find the slope first with m = (y₂ − y₁) ÷ (x₂ − x₁), then put either point into b = y₁ − m × x₁ to get the y-intercept. The equation is y = mx + b. Both points give the same intercept, so using the other one checks your work.

What do m and b mean?

m is the slope — how far the line rises for each step to the right. b is the y-intercept, the y-value where the line crosses the y-axis, which is the point (0, b).

Can every line be written as y = mx + b?

No. Vertical lines cannot, because they have no slope — one x-value corresponds to every y, so y is not a function of x. Those lines are written x = c instead.

What is b when the line passes through the origin?

Zero, and the equation shortens to y = mx. A line through the origin crosses the y-axis at (0, 0), so there is no constant to add.