ThisCalculator

Everyday

Reverse Slope Intercept Calculator

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.

Reverse Slope Intercept Calculator

This calculator works out the equation of a straight line in slope-intercept form (y = mx + b) when you provide two points on the line, or when you provide the slope and one point. You enter the x and y coordinates of two points (or a slope and a point), and the calculator returns the slope (m), the y-intercept (b), and the full equation of the line.

Formula

The slope-intercept form of a linear equation is:

y = mx + b

  • m = slope of the line (rise over run), unitless
  • b = y-intercept, the y-coordinate where the line crosses the y-axis (same unit as y)
  • x and y are the coordinates of any point on the line

Given two points (x�, y�) and (x₂, y₂), the slope is:

m = (y₂ – y�) / (x₂ – x�)

Then the y-intercept is found by plugging one point into the equation:

b = y� – m·x�

This is sometimes called the “reverse� slope intercept calculator because you start with the coordinates and work backward to find the equation, instead of starting with the equation to plot points.

Worked Example

Using the default values from the calculator above: Point 1 = (1, 2) and Point 2 = (3, 4).

  1. Calculate the slope:
    m = (4 – 2) / (3 – 1) = 2 / 2 = 1
  2. Find the y-intercept using Point 1:
    b = 2 – (1 × 1) = 1
  3. Write the equation:
    y = 1x + 1, or simply y = x + 1

The calculator shows m = 1, b = 1, and the equation y = x + 1. You can verify by plugging in x = 3: y = 3 + 1 = 4, which matches Point 2.

When to Use This Calculator

Use this tool whenever you have two points on a line and need the line’s equation. Common situations include:

  • Algebra homework: “Find the equation of the line through (2, 5) and (4, 9).�
  • Data analysis: you have two data points from a linear trend and want to predict intermediate values.
  • Physics experiments: you measured two (x, y) points and need the linear relationship.
  • Graphing: you want to draw a line on a chart but only know two points.

If you already have the slope and one point, the same formulas work: enter the slope as (y₂ – y�) and any point as (x�, y�) – but the calculator above expects two points. For slope + point, you can use the formulas manually: b = y – m·x.

How to Read the Result

The slope m tells you how steep the line is. A positive slope means the line rises from left to right; a negative slope means it falls. A slope of zero means a horizontal line. The y-intercept b is where the line crosses the y-axis (x = 0). For example, y = 2x – 3 has a slope of 2 and crosses the y-axis at -3.

The equation itself is the most useful output: you can plug in any x value to find the corresponding y, or rearrange to find x given y.

Common Mistakes and Pitfalls

  • Dividing by zero: If x� = x₂, the line is vertical and the slope is undefined. The calculator will show an error or infinity. A vertical line cannot be written in slope-intercept form.
  • Unit mix-ups: The slope has no units because both axes use the same units. But if your x and y have different units (e.g., time in minutes and distance in km), the slope’s unit is km/min, not just a number. The calculator treats all numbers as unitless.
  • Rounding too early: If you round m before computing b, you can get a slightly different intercept. The calculator rounds only the final display, not intermediate values.
  • Swapping points: You can swap the two points and the slope will be the same, but if you accidentally mix x and y within a point, you’ll get a wrong result.

Limits of the Formula

The slope-intercept form works for any non-vertical line. Vertical lines (x = constant) cannot be expressed as y = mx + b because the slope is infinite. Also, the formula assumes a perfectly linear relationship – real-world data often has noise, and this calculator gives the exact line through two points, not a best-fit line. For more than two points with scatter, you would use linear regression instead.

Another limitation: the y-intercept may be far outside the range of your data. For example, if your points are (100, 200) and (200, 400), the intercept is 0, but if they are (1000, 1001) and (1001, 1002), the intercept is 1, which is far from the data. That’s fine mathematically, but be cautious when extrapolating far from your known points.

Frequently Asked Questions

What is the “reverse� slope intercept?

Normally you start with an equation and plot it. The reverse process is finding the equation from two points. That’s exactly what this calculator does: you input coordinates, and it outputs m and b.

Can I use this calculator if I only have the slope and one point?

Yes, but you need to enter two points. If you have slope m and point (x�, y�), you can create a second point by moving 1 unit in x: (x�+1, y�+m). Then enter both points. Or just use the formula b = y� – m·x� manually.

What if my line is vertical?

Vertical lines have an undefined slope and cannot be written in y = mx + b form. The calculator will show an error because the denominator (x₂ – x�) is zero. You would write the equation as x = constant.

How do I find the x-intercept from the slope-intercept form?

Set y = 0 and solve for x: 0 = mx + b → x = -b/m. For example, y = 2x – 6 has x-intercept 3. The calculator above does not directly give the x-intercept, but you can compute it from the outputs.

What if my points have negative coordinates?

Negative coordinates work fine. The formulas handle negative numbers correctly. For example, points (-1, -2) and (2, 4) give slope m = (4 – (-2)) / (2 – (-1)) = 6/3 = 2, and b = -2 – 2*(-1) = 0, so the equation is y = 2x.

Why does the calculator show “y = 1x + 1� instead of “y = x + 1�?

The calculator displays the coefficient explicitly so you can see the slope value. In math notation, a slope of 1 is usually written without the 1, but both mean the same thing. You can simplify the output yourself.

Related

Formula used
in x1 | x� | - | 1 | 0
in y1 | y� | - | 2 | 0
in x2 | x₂ | - | 3 | 0
in y2 | y₂ | - | 4 | 0
out m | Slope (m) | - | (y2 - y1) / (x2 - x1) | 4
out b | Y-intercept (b) | - | y1 - m * x1 | 4
out eq | Equation | - | "y = " + m + "x + " + b | 0

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.