ThisCalculator

Everyday

Slope Intercept Formula Calculator: Find Slope and Intercept

Updated · Standard formula, shown below

Slope 2.00
Y-intercept
0.00
Result
Equation y=mx+b, with coefficients above
2.00
Result
First point x-coordinate
1
You entered

Slope Intercept Formula Calculator: Find Slope and Intercept

A slope-intercept formula calculator finds the slope and y-intercept of a straight line and writes its equation as y = mx + b. Enter two points on the line; the calculator returns the slope, intercept, and equation, provided the points have different x-coordinates.

Formula

The slope-intercept form of a line is y = mx + b. Given two points, calculate the slope first, then use either point to calculate the intercept:

  • m = (y₂ − y₁) / (x₂ − x₁), where (x₁, y₁) and (x₂, y₂) are the two points. The slope is the change in y divided by the change in x.
  • b = y₁ − mx₁. This is the y-value where the line crosses the y-axis, which occurs when x = 0.
  • y = mx + b gives the line’s equation. Here, x and y are coordinates, m is the slope, and b is the y-intercept.

The coordinates and slope are unitless when working with ordinary graph coordinates. In an applied problem, the slope has units of y per unit of x—for example, miles per hour if y is distance in miles and x is time in hours. The intercept has the same units as y.

Worked Example

Use the calculator’s default points: (1, 2) and (3, 6).

  1. Find the change in y: 6 − 2 = 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 = 2 − (2 × 1) = 0.
  5. Substitute the values into y = mx + b: y = 2x + 0, or simply y = 2x.

The slope is 2 and the y-intercept is 0. The equation predicts y = 4 at x = 2, which lies between the two input points.

How to Use the Calculator

Enter the x- and y-coordinates of two points that lie on the same straight line. Keep each coordinate paired correctly: x₁ and y₁ must describe one point, while x₂ and y₂ describe the other. The calculator computes the slope and intercept from those entries.

  • For a point written as (−2, 5), enter −2 as its x-coordinate and 5 as its y-coordinate.
  • Coordinates can be decimals or negative numbers. The input order does not change the line as long as each point remains paired correctly.
  • Use exact values where practical, then round the displayed results to the precision your task requires.

The equation output line in this specification represents the calculation m × 1 + b, not a text-formatted equation. Read the slope and intercept outputs as the coefficients to place in y = mx + b. For the default values, they produce y = 2x + 0. A calculator that displays equations as text may present that result directly.

What Slope and Intercept Tell You

Slope describes how quickly y changes as x increases. A positive slope means y rises from left to right; a negative slope means it falls. A slope of zero describes a horizontal line. For example, a slope of −3 means y decreases by 3 for every 1-unit increase in x.

The y-intercept is the line’s value at x = 0. In a graph, it is where the line crosses the vertical axis. In a real-world model, that can represent a starting amount, such as an initial distance or a fixed fee, but only if x = 0 and the line’s model make sense in that context.

Coordinates do not have to use the same physical unit for x and y. If x is measured in hours and y in kilometers, the slope is in kilometers per hour. If you change the unit scale, the numerical slope may change even though the underlying relationship does not.

When This Formula Applies

Use slope-intercept form when the relationship is linear and the line is not vertical. Two distinct points determine one such line. This form is useful for graphing, interpreting a rate of change, and predicting y-values from x-values within a suitable model.

A vertical line is the important exception. Its two points have the same x-coordinate, so x₂ − x₁ = 0 and the slope calculation would require division by zero. A vertical line has an equation such as x = 4, not y = mx + b; it has no defined slope or y-intercept in the usual slope-intercept sense.

Two identical points are also insufficient to determine a unique line: infinitely many lines pass through one point. The calculator’s two-point method therefore requires distinct points with different x-values.

Common Mistakes and Limits

  • Reversing only part of the subtraction: If you calculate y₂ − y₁ in the numerator, use x₂ − x₁ in the denominator. Reversing both differences gives the same slope; reversing just one changes its sign.
  • Mixing up coordinates: The first number in an ordered pair is x, and the second is y. Swapping them can produce a different line.
  • Assuming the intercept is one of the given points: The y-intercept is where x equals zero. It is not necessarily either input point.
  • Rounding too soon: Keep extra digits during intermediate calculations, then round the final slope and intercept. Early rounding can slightly alter the equation.
  • Using a line for nonlinear data: Two points always define a nonvertical line, but that does not prove a larger data set follows a straight-line pattern. A line based on two observations may not describe the relationship elsewhere.

The calculation gives the exact line through the entered points, subject to input precision. It does not assess whether those points are accurate, whether a linear model is appropriate, or how reliably the line predicts values beyond the observed range.

Frequently Asked Questions

What is the slope-intercept formula?
The formula is y = mx + b. The variable m is the slope, and b is the y-intercept.

How do you find slope from two points?
Subtract the y-coordinates and divide by the corresponding difference in x-coordinates: m = (y₂ − y₁) / (x₂ − x₁). The x-coordinates must differ.

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

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, and it is written as x = c instead.

Does the order of the two points matter?
No, if each point’s x- and y-coordinates stay together. Swapping the complete points reverses both differences in the slope formula, leaving the same slope and line.

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 | - | 6
out m | Slope | - | (y2 - y1) / (x2 - x1) | 2
out b | Y-intercept | - | y1 - m * x1 | 2
out equation | Equation y=mx+b, with coefficients above | - | m * 1 + 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.