ThisCalculator

Everyday

Slope Intercept Form Calculator: Find y = mx + b

Updated · Standard formula, shown below

Slope-intercept equation value at x = 0 1.00 y
Slope m
1.00
Result
Y-intercept b
1.00
Result
First point x-coordinate
1
You entered

Slope Intercept Form Calculator: Find y = mx + b

A slope-intercept form calculator rewrites a line as y = mx + b using information such as its slope and a point, or two points on the line. Enter the values for a line, and the calculator returns its equation, including the slope m and y-intercept b.

Formula

The calculator uses two points, (x₁, y₁) and (x₂, y₂), to find the slope and intercept of the line passing through them. The slope-intercept equation is y = mx + b, where m is the slope and b is the y-intercept.

  • Slope: m = (y₂ − y₁) / (x₂ − x₁). It measures the change in y divided by the change in x.
  • Y-intercept: b = y₁ − mx₁. This is the y-value when x equals zero.
  • Equation value at x = 0: the first output is y₁ − [(y₂ − y₁) / (x₂ − x₁)]x₁, which is the intercept b. The calculator then displays the slope and intercept separately so you can write the complete equation.

The coordinates are entered as numbers, without units. If your graph has units, keep a consistent unit for each axis; the slope’s units are y-units per x-unit, while the intercept has the same units as y.

Worked Example

Using the default points (1, 2) and (3, 4):

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

The first output, the equation value at x = 0, is 1.00; the slope is 1.00 and the y-intercept is 1.00. Together they give y = 1.00x + 1.00, equivalent to y = x + 1.

What Slope-Intercept Form Tells You

Slope-intercept form makes two features of a straight line easy to read. The coefficient of x is the slope: it describes the line’s direction and steepness. The constant term is the y-intercept: the point where the line crosses the vertical axis, written as (0, b).

  • A positive slope means y increases as x increases.
  • A negative slope means y decreases as x increases.
  • A slope of zero gives a horizontal line, such as y = 4.
  • A larger absolute slope means a steeper line, provided the axes use the same scale.

For example, in y = −2x + 5, the slope is −2 and the line crosses the y-axis at (0, 5). Moving one unit to the right corresponds to moving two units down. If x and y represent different quantities, the slope also expresses how much y changes per unit of x.

How to Use the Calculator

Choose two distinct points that lie on the line, then enter each point’s x- and y-coordinates in the matching fields. The order does not matter: switching the points changes the order of subtraction in both differences, but produces the same slope and equation.

Check that the points are actually on the same straight line. If they come from measured data that only approximately follows a line, the equation through two selected points may not represent the whole dataset well. A line of best fit is a different calculation: it uses multiple data points and a regression method.

Special Cases and Common Mistakes

The two-point method requires different x-coordinates. If x₁ = x₂, the denominator in the slope formula is zero, so the line is vertical and cannot be expressed as y = mx + b. Its equation instead has the form x = c, where c is the shared x-coordinate.

  • Reversing the subtraction: Use the same point order in the numerator and denominator. For example, pair y₂ − y₁ with x₂ − x₁.
  • Mixing coordinates: Keep each x-coordinate paired with its own y-coordinate. A point (2, 7) is not interchangeable with (7, 2).
  • Rounding too early: Keep full precision during the calculation and round the displayed values at the end. Rounded slope and intercept values may not pass exactly through the original points.
  • Confusing intercepts: The y-intercept is where x = 0. The x-intercept is where y = 0, and it is not the constant b.
  • Ignoring scale or units: A graph’s visual steepness depends on its axis scales. For physical quantities, the slope carries y-units per x-unit.

When to Use This Form and Its Limits

Use slope-intercept form when you want to graph a nonvertical line quickly, identify its rate of change and starting value, or compare two linear relationships. To graph y = mx + b, plot the intercept (0, b), then use the slope as rise over run. A slope of 3/2 means move two units right and three units up; a slope of −3/2 means move two right and three down.

This form is not the only way to describe a line. Standard form, often written Ax + By = C, can be more convenient for integer coefficients or systems of equations. Point-slope form, y − y₁ = m(x − x₁), is useful when you know one point and the slope. A vertical line has no finite slope and must use a form such as x = 3. Also, a straight-line equation assumes a constant rate of change; it is not suitable for a relationship that curves or changes slope.

Frequently Asked Questions

How do I find slope-intercept form from two points?
Calculate m = (y₂ − y₁)/(x₂ − x₁), then substitute either point into b = y − mx. Put the results into y = mx + b. The x-coordinates must differ.

How do I convert from point-slope form to slope-intercept form?
Start with y − y₁ = m(x − x₁), distribute m, then isolate y. The result is y = mx + (y₁ − mx₁), so the intercept is b = y₁ − mx₁.

Can a vertical line be written in slope-intercept form?
No. A vertical line has an undefined slope because its x-change is zero. Write it as x = c, where c is the constant x-coordinate.

What if I know the slope and one point instead of two points?
Use the known slope m and point (x₁, y₁) in b = y₁ − mx₁. Then write y = mx + b. Two points are not necessary when the slope is already known.

Is the y-intercept always on the graph?
It is part of the line, but it may not appear in the visible portion of a particular graph. The y-intercept is the value the line would have at x = 0, even if the graph window does not show that location.

Related

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