ThisCalculator

Everyday

Slope Intercept Equation Calculator: Find y = mx + b

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Slope Intercept Equation Calculator: Find y = mx + b

A slope-intercept equation calculator finds the line equation in the form y = mx + b from a slope and a y-intercept. Enter those two values to get the equation, with the slope and intercept shown as helpers.

Formula

The slope-intercept form of a straight line is y = mx + b.

  • m is the slope: the change in y divided by the corresponding change in x. It is measured in y-units per x-unit, or is unitless when both axes use the same units.
  • b is the y-intercept: the value of y where the line crosses the y-axis. It uses the same units as y.
  • x is an input value on the horizontal axis, and y is the resulting value on the vertical axis.

The calculator reports the equation symbolically as y = mx + b, substituting your values for m and b. The variables x and y remain because the equation describes every point on the line, not one particular point. The two extra outputs repeat the entered slope and intercept for easy checking.

Worked Example

With the default inputs, the slope is m = 2 and the y-intercept is b = 3.

  1. Start with y = mx + b.
  2. Substitute m = 2 and b = 3: y = 2x + 3.
  3. The calculator’s equation output is y = 2x + 3; its slope is 2 and its y-intercept is 3.

For example, if x = 4, then y = 2(4) + 3 = 11. That point is (4, 11), and it lies on the line described by the equation.

How to Use a Slope-Intercept Calculator

Enter the slope and y-intercept as numbers. A positive slope means the line rises as x increases; a negative slope means it falls. A slope of zero gives a horizontal line. The intercept can be positive, negative, or zero.

  • If the equation is already written as y = 5x − 7, enter m = 5 and b = −7.
  • If the line crosses the y-axis at 4 and rises 3 units for every 2 units to the right, enter m = 3/2 and b = 4.
  • If the line passes through the origin, enter b = 0.

A slope can be entered as a decimal or fraction if the calculator accepts the input format. Keep its sign: a slope of −2 is not the same as 2. Also check which variable is on each axis. The meaning and units of the slope depend on the x- and y-units.

Finding the Slope and Intercept from Other Information

If you have two points, first calculate the slope. For points (x₁, y₁) and (x₂, y₂), use m = (y₂ − y₁) / (x₂ − x₁), provided x₂ is not equal to x₁. Then substitute either point into y = mx + b and solve for the intercept: b = y₁ − mx₁.

For example, the points (1, 5) and (3, 9) give m = (9 − 5) / (3 − 1) = 2. Using (1, 5), b = 5 − 2(1) = 3, so the line is y = 2x + 3. You can then enter 2 and 3 into the calculator to check the equation.

If you know one point and the slope, use the same rearrangement, b = y − mx. If you have only a graph, identify two clear points on the line to find the slope, then read or calculate where it crosses the y-axis. Estimating from a graph may produce an approximate result rather than an exact equation.

Reading the Equation and Its Limits

In y = mx + b, the slope tells how much y changes when x increases by one unit. For example, if x is time in hours and y is distance in miles, a slope of 60 means 60 miles per hour. The intercept is the model’s predicted distance at time zero. That interpretation is meaningful only if the chosen zero and the linear model make sense for the situation.

The equation describes a straight line and assumes a constant rate of change. It does not automatically fit curved data or guarantee that predictions outside the observed range are reliable. For a vertical line, such as x = 4, slope-intercept form does not work: its slope is undefined, and it cannot be written as y = mx + b.

Units matter. If y is measured in meters and x in seconds, m has units of meters per second and b has units of meters. Converting either axis changes the numerical values of the slope and possibly the intercept. Convert measurements consistently before interpreting them; do not compare slopes based on different units without accounting for the conversion.

Common Mistakes

  • Reversing the slope calculation: use change in y divided by change in x, keeping the order consistent in both differences.
  • Dropping a negative sign: a negative intercept places the crossing below the origin, while a negative slope makes the line descend from left to right.
  • Confusing the intercept with a point’s y-value: b is specifically the y-value when x = 0, not the y-value at every point.
  • Mixing up x- and y-intercepts: the y-intercept is where the line crosses the vertical axis. The x-intercept is where y = 0.
  • Rounding too early: retain the exact fraction or extra decimal places while calculating, then round the final values to a sensible precision.

A related misconception is that every linear equation is already in slope-intercept form. An equation such as 2x + 3y = 6 is linear, but it must be rearranged: 3y = −2x + 6, so y = −(2/3)x + 2. Its slope is −2/3 and its y-intercept is 2.

Frequently Asked Questions

What is the slope-intercept form of a line?
It is y = mx + b, where m is the slope and b is the y-intercept.

How do I find b from a point and a slope?
Substitute the point’s x- and y-coordinates and the slope into b = y − mx. The result is the y-intercept.

Can the slope-intercept equation have a negative slope?
Yes. A negative m means y decreases as x increases. For example, y = −3x + 2 has slope −3 and y-intercept 2.

What is the y-intercept when a line passes through the origin?
It is zero, so the equation has the form y = mx.

Can a vertical line be written as y = mx + b?
No. A vertical line has an undefined slope and is written in the form x = c, where c is a constant.

Related

Formula used
in m | Slope | - | 2 | 
in b | Y-intercept | - | 3 | 
out equation | Slope-intercept equation | - | m * x + b | 0
out slope | Slope | - | m | 2
out intercept | Y-intercept | - | b | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.