ThisCalculator

Math

Slope Intercept Form Calculator: Find y = mx + b

Updated · Standard formula, shown below

Slope 2.00
Y-intercept
1.00
Result
Equation value at x2
7.00
Result
First point x-coordinate
1
You entered

Slope Intercept Form Calculator: Find y = mx + b

A slope-intercept form calculator finds the equation of a straight line, written as y = mx + b, from two points or from a point and a slope. Enter the relevant coordinates and slope; the calculator returns the line’s slope and y-intercept so you can write its equation.

Formula

The standard slope-intercept equation is y = mx + b. To calculate it from two points, first find the slope, then use either point to find the y-intercept:

  • m = (y₂ − y₁) / (x₂ − x₁), where m is the slope and (x₁, y₁) and (x₂, y₂) are the two points.
  • b = y₁ − mx₁, where b is the y-coordinate where the line crosses the y-axis.
  • y = mx + b, where x is any input value and y is the corresponding output value on the line.

The coordinates and slope are unitless numbers unless the problem assigns units. If x and y represent different quantities, the slope has units of y per unit of x; for example, miles per hour when y is distance in miles and x is time in hours. The intercept has the same units as y.

Worked Example

Using the calculator’s default points, (1, 3) and (3, 7):

  1. Find the change in y: 7 − 3 = 4.
  2. Find the change in x: 3 − 1 = 2.
  3. Calculate the slope: m = 4 / 2 = 2.
  4. Use the first point to find the intercept: b = 3 − (2 × 1) = 1.
  5. Write the equation: y = 2x + 1. Check the second point: 2 × 3 + 1 = 7.

The calculator therefore gives a slope of 2, a y-intercept of 1, and a check value of 7.

What Slope-Intercept Form Tells You

Slope describes how much y changes when x increases by one unit. A positive slope means the line rises from left to right; a negative slope means it falls. A slope of zero describes a horizontal line. The y-intercept, b, is the value of y when x equals zero, so the line crosses the vertical axis at (0, b).

For example, in y = 2x + 1, each increase of 1 in x raises y by 2, and the line crosses the y-axis at (0, 1). The intercept need not be a whole number or positive. In y = −0.5x + 4, the line begins at y = 4 when x = 0 and decreases by 0.5 for each unit increase in x.

When to Use This Calculator

Use the two-point method when you know two distinct points on a straight line. It is useful for checking algebra exercises, graphing a line, or describing a constant rate of change. If you already know the slope and one point, you can skip the slope calculation and use b = y − mx directly.

For instance, suppose a line passes through (2, 5) and has slope 3. Substituting into b = y − mx gives b = 5 − (3 × 2) = −1, so the line is y = 3x − 1. This method works because every point on the line must satisfy its equation.

Common Input Problems and Limits

  • Reversing coordinates: Write each point in (x, y) order. Use the y-values in the numerator and x-values in the denominator.
  • Mixing subtraction order: Either order is valid only if used consistently: (y₂ − y₁) / (x₂ − x₁), not (y₂ − y₁) / (x₁ − x₂).
  • Using identical x-coordinates: If x₂ − x₁ = 0, the slope is undefined. The points make a vertical line, which cannot be written as y = mx + b; its equation is x = a.
  • Rounding too early: Keep full precision in intermediate steps when working by hand, then round the final result to the precision the problem requires. Rounded coefficients may make the equation miss the supplied points slightly.
  • Expecting a curved relationship to be a line: Two points always determine a line, but that line may not describe other data points or a nonlinear pattern.

The formula assumes a straight line and consistent coordinate units. If measurements use different scales, such as x in minutes and y in seconds, convert or clearly interpret the slope’s units before using it. A line can also have an intercept outside the meaningful range of a real-world situation; the equation remains mathematically defined, but its practical interpretation may not.

Frequently Asked Questions

How do I find slope-intercept form from two points?
Calculate m = (y₂ − y₁) / (x₂ − x₁), then calculate b = y₁ − mx₁. Put those values into y = mx + b.

What if I know the slope and one point?
Use the point (x, y) and slope m in b = y − mx. Then write the equation as y = mx + b.

Can a vertical line be written in slope-intercept form?
No. A vertical line has an undefined slope because its x-coordinate does not change between points. Write it as x = a instead.

What does b mean in y = mx + b?
b is the y-intercept: the y-value at x = 0. The line crosses the y-axis at the point (0, b).

Does the order of the two points matter?
No, provided you subtract in matching order in both parts of the slope formula. Swapping point 1 and point 2 changes both signs, leaving the slope unchanged.

Related

Formula used
in x1 | First point x-coordinate | - | 1
in y1 | First point y-coordinate | - | 3
in x2 | Second point x-coordinate | - | 3
in y2 | Second point y-coordinate | - | 7
out m | Slope | - | (y2 - y1) / (x2 - x1) | 2
out b | Y-intercept | - | y1 - m * x1 | 2
out equation_check | Equation value at x2 | - | m * x2 + 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.