y = mx + b Calculator

A line passes through the points (2, 5) and (6, 13). What is its equation? If you stared at that on a test and froze, you are not alone – finding the slope-intercept form under pressure trips up students and professionals alike. The y = mx + b calculator above removes the guesswork: enter what you know (two points, or a slope with a point, or m and b directly), and it returns the full equation, step by step.

Input Method
Enter Two Points
Calculation Steps

What Is y = mx + b?

y = mx + b is the slope-intercept form of a linear equation in two variables. Each symbol has a specific geometric meaning:

SymbolNameMeaning
mSlopeRise over run; how much y changes when x increases by 1
by-interceptThe y-value where the line crosses the y-axis (x = 0)
xIndependent variableInput value you choose
yDependent variableOutput the equation produces

A line with m = 3 and b = −4 has the equation y = 3x − 4. Every point on that line – (0, −4), (1, −1), (2, 2) – satisfies the equation exactly.

How to Find m and b from Two Points

Given two points (x₁, y₁) and (x₂, y₂), the calculation has two steps.

Step 1 – Calculate the slope:

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

Step 2 – Calculate the y-intercept:

Substitute either point and the slope into y = mx + b, then solve for b:

b = y₁ − m · x₁

Worked example

Points: (2, 5) and (6, 13).

  1. m = (13 − 5) / (6 − 2) = 8 / 4 = 2
  2. b = 5 − 2 · 2 = 5 − 4 = 1

Equation: y = 2x + 1

The calculator above performs both steps instantly and shows the intermediate values.

How to Convert Other Forms to y = mx + b

Linear equations show up in several formats. Here is how each converts to slope-intercept form.

From standard form (Ax + By = C)

  1. Subtract Ax from both sides: By = −Ax + C
  2. Divide every term by B: y = (−A/B)x + (C/B)
  3. Read off m = −A/B, b = C/B

Example: 3x + 4y = 12 → y = (−3/4)x + 3, so m = −0.75 and b = 3.

From point-slope form (y − y₁ = m(x − x₁))

  1. Distribute m: y − y₁ = mx − mx₁
  2. Add y₁ to both sides: y = mx − mx₁ + y₁
  3. Combine constants: b = y₁ − mx₁

This is algebraically identical to the two-point method – it just starts from a known slope instead of computing one.

From two intercepts

If the line crosses the x-axis at (a, 0) and the y-axis at (0, b):

  1. m = (b − 0) / (0 − a) = −b / a
  2. The equation is y = (−b/a)x + b

When Does y = mx + b Not Apply?

The slope-intercept form requires a defined, finite slope. Two situations break this:

  • Vertical lines (x = c): the denominator x₂ − x₁ equals 0, making the slope undefined. There is no y = mx + b representation.
  • Horizontal lines (y = c): these do fit the form with m = 0 and b = c, giving y = 0x + c, or simply y = c.

Practical Uses of y = mx + b

The slope-intercept form is not just a textbook exercise. It models real-world relationships where a quantity changes at a constant rate.

ApplicationWhat m representsWhat b represents
Hourly wagesPay rate per hourBase pay or signing bonus
Phone billCost per minuteMonthly fixed fee
DepreciationAnnual value lossOriginal asset value
Distance over timeSpeedStarting position
Temperature conversion (°C to °F)9/532 (freezing point offset)

For instance, the conversion °F = (9/5)·°C + 32 is a y = mx + b equation with m = 1.8 and b = 32.

Common Mistakes to Avoid

  • Swapping the slope formula. Using (x₂ − x₁)/(y₂ − y₁) or (y₁ − y₂)/(x₂ − x₁) produces the wrong sign or an inverted value. Always (y₂ − y₁) over (x₂ − x₁).
  • Forgetting to solve for b. Finding m is only half the task. Without b, you do not have the equation of the line.
  • Mixing up x and y when substituting. Plugging x₁ into y₁’s spot gives an incorrect b. Double-check that the coordinates stay paired.
  • Dividing incorrectly in standard-form conversion. Every term – including the constant – must be divided by B.

Quick Reference: Slope and y-Intercept at a Glance

Scenariomb
Line rises left to rightPositiveAny value
Line falls left to rightNegativeAny value
Horizontal line0The constant y-value
Vertical lineUndefinedDoes not exist
Parallel linesSame mDifferent b
Perpendicular linesm₁ · m₂ = −1Any values

This calculator provides mathematical results only. For financial, scientific, or engineering decisions, verify results against applicable standards and professional guidelines.

Frequently Asked Questions

What does each variable in y = mx + b represent?
y is the dependent variable (output), x is the independent variable (input), m is the slope (rate of change), and b is the y-intercept (the value of y when x equals 0).
Can a linear equation have no y-intercept?
Every non-vertical line has a y-intercept. A vertical line (x = c) has an undefined slope and no y-intercept in slope-intercept form because it never crosses the y-axis unless c = 0.
How do I find the equation from one point and the slope?
Plug the known slope m and the point (x₁, y₁) into y = mx + b, then solve for b: b = y₁ − m · x₁. The calculator above handles this automatically.
What if the slope between two points is undefined?
If x₂ − x₁ = 0, the line is vertical. Its equation is x = c (where c is the shared x-coordinate), and it cannot be written in y = mx + b form.
How do I convert Ax + By = C to slope-intercept form?
Subtract Ax from both sides to get By = −Ax + C, then divide every term by B: y = (−A/B)x + (C/B). Now m = −A/B and b = C/B.
  1. Slope Formula: Find Slope Between Two Points
  2. Composite Function Calculator – f(g(x)) Solver
  3. Discriminant Calculator | Solve Quadratic Equations Instantly
  4. Linear Equation Calculator
  5. Radical Calculator – Simplify and Compute Roots Instantly
  6. Polynomial Calculator: Evaluate, Solve & Simplify Polynomials Online