terican

Last verified · v1.0

Calculator · math

Slope Intercept Form Calculator

Calculate slope and y-intercept from two coordinate points using y = mx + b. Instantly derive the full slope-intercept equation for any straight line.

FreeInstantNo signupOpen source

Inputs

Result (m or b)

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Result (m or b)

The formula

How the
result is
computed.

What Is Slope-Intercept Form?

Slope-intercept form is one of the most widely used representations of a linear equation in algebra. Written as y = mx + b, this equation describes any straight line on a coordinate plane using just two values: the slope (m) and the y-intercept (b). According to Khan Academy's introduction to slope-intercept form, this notation immediately communicates how steep a line is and where it crosses the vertical axis, which is why it remains the most common linear form taught in algebra courses worldwide.

Breaking Down the Formula

The equation y = mx + b contains four distinct components:

  • y — the dependent variable, plotted on the vertical axis
  • m — the slope, measuring the rate of change (rise divided by run)
  • x — the independent variable, plotted on the horizontal axis
  • b — the y-intercept, the value of y when x equals zero

Together, these two parameters fully define any non-vertical straight line in two-dimensional space.

How to Calculate Slope (m)

Given two points (x1, y1) and (x2, y2), slope is calculated using the difference quotient:

m = (y2 - y1) / (x2 - x1)

This ratio quantifies how much y changes for each one-unit increase in x. A slope of 4 means the line rises 4 units vertically for every 1 unit moved to the right. A slope of -3 means the line falls 3 units per rightward step. As documented in Richland Community College's Lines in the Plane reference, slope is undefined when x1 equals x2 because vertical lines produce division by zero in the formula.

How to Calculate the Y-Intercept (b)

Once slope is determined, the y-intercept is isolated by rearranging the slope-intercept equation:

b = y1 - m * x1

Substitute any known point (x1, y1) along with the computed slope to solve for b. For instance, if m = 3 and the line passes through (2, 9): b = 9 - 3(2) = 9 - 6 = 3, yielding the full equation y = 3x + 3. According to BYU-Idaho's guide on finding a line equation from two points, this substitution method is the standard algebraic approach when a slope-intercept equation must be derived from coordinate data alone.

Worked Example

Find the slope-intercept equation for the line passing through (1, 4) and (5, 12).

  • Step 1 — Slope: m = (12 - 4) / (5 - 1) = 8 / 4 = 2
  • Step 2 — Y-Intercept: b = 4 - 2(1) = 4 - 2 = 2
  • Step 3 — Final Equation: y = 2x + 2

Verification: substitute x = 5 into y = 2(5) + 2 = 12. This matches the second point exactly, confirming the equation is correct.

Real-World Applications

Slope-intercept form appears across a broad range of practical disciplines:

  • Economics: Cost functions are modeled as C = mQ + b, where m is the variable cost per unit and b is the fixed overhead cost regardless of output volume.
  • Physics: Constant-velocity motion graphs express distance as d = vt + d0, directly mirroring the slope-intercept structure with speed as slope.
  • Finance: Linear depreciation of an asset over time uses this form, with slope representing annual value loss and b representing original purchase price.
  • Data Science: Simple linear regression produces a best-fit line in slope-intercept form that minimizes squared prediction error across an entire dataset.

Special Cases to Know

Horizontal Lines (m = 0)

When y1 equals y2, the slope is zero and the equation simplifies to y = b. The line runs parallel to the x-axis at a constant height with no incline whatsoever.

Vertical Lines (Undefined Slope)

When x1 equals x2, division by zero renders slope undefined. Vertical lines cannot be expressed in slope-intercept form and are instead written as x = c, where c is the constant horizontal position.

Lines Through the Origin (b = 0)

When the y-intercept is zero, the equation reduces to y = mx, describing a direct proportional relationship that passes through the coordinate origin (0, 0), common in scientific and engineering models.

Reference

Frequently asked questions

What is slope-intercept form and what does each part of y = mx + b represent?
Slope-intercept form, written as y = mx + b, is a standard algebraic representation of any straight line. The variable m is the slope, measuring the rate at which y changes relative to x. The variable b is the y-intercept — the exact point where the line crosses the vertical y-axis. For example, in y = 3x + 5, the slope is 3 (the line rises 3 units for every 1 unit moved right) and the y-intercept is 5 (the line crosses the y-axis at the coordinate point (0, 5)).
How do you calculate the slope between two points using the slope formula?
Apply the formula m = (y2 - y1) / (x2 - x1) to any two points (x1, y1) and (x2, y2). Subtract the y-coordinates to get the rise, subtract the x-coordinates to get the run, then divide rise by run. For example, given points (2, 3) and (8, 15): m = (15 - 3) / (8 - 2) = 12 / 6 = 2. This means the line rises exactly 2 units vertically for every 1 unit it travels horizontally to the right.
How do you find the y-intercept (b) from two coordinate points?
First calculate slope using m = (y2 - y1) / (x2 - x1). Then substitute the slope and one known point into the rearranged formula b = y1 - m * x1. For example, if slope equals 4 and the line passes through (3, 14): b = 14 - 4(3) = 14 - 12 = 2. The y-intercept is 2, making the complete slope-intercept equation y = 4x + 2. Either point can be used in the substitution — both yield the same result.
What does a negative slope mean on a graph?
A negative slope indicates the line descends from left to right — as x increases, y decreases. The equation y = -2x + 10 has a slope of -2, meaning every 1-unit rightward step causes y to drop by 2 units. Real-world examples include declining asset values over time, decreasing temperature as altitude increases, or a car decelerating toward a stop. The larger the absolute value of a negative slope (for example, -5 vs. -1), the steeper and faster the line descends across the coordinate plane.
What is the difference between slope-intercept form and point-slope form?
Slope-intercept form (y = mx + b) defines a line using slope and the specific y-intercept value, making it the most convenient form for graphing and for reading off key properties directly. Point-slope form, written as y - y1 = m(x - x1), defines a line using slope and any arbitrary point on the line — not necessarily the y-intercept. Both forms represent the same line and are algebraically equivalent. Slope-intercept is most efficient when the y-intercept is already known; point-slope is preferable when starting from a slope and a non-intercept point.
Can slope-intercept form represent a vertical line?
No. Vertical lines cannot be expressed in slope-intercept form because their slope is mathematically undefined. A vertical line shares the same x-value for every point along it, which causes the denominator in m = (y2 - y1) / (x2 - x1) to equal zero — making the division undefined. Vertical lines are instead written in the form x = c, where c is the fixed x-coordinate. For example, a line passing through (4, 0), (4, 5), and (4, -3) is expressed simply as x = 4.