Math

Slope-Intercept Form Calculator

Find the slope-intercept equation of a line through two points.


Slope-Intercept Form Calculator

Advertisement

Given two points, this finds the full slope-intercept equation (y = mx + b) of the line passing through them.

How it works

The slope is the change in y divided by the change in x between the two points; the y-intercept is then found by substituting one point back into the equation and solving for b.

What this does not include

This does not include a road-grade-style rise/run percentage — for that, use this site’s slope percentage calculator instead. This tool produces a full algebraic line equation.

How to use this calculator

  1. Enter the x and y coordinates of both points.

A worked example

Points (0, 1) and (2, 5): slope = (5−1)/(2−0) = 2, giving y = 2x + 1.

Points (1, 2) and (3, 2): slope = 0, giving the horizontal line y = 2.

What the variables mean

Variable Meaning
(x1, y1), (x2, y2) Two points the line passes through
Slope, intercept The m and b values in y = mx + b

Edge cases worth knowing

A slope of zero produces a horizontal line, not an error — the second example shows this directly, since both points share the same y-value.

Two points sharing the same x-value describe a vertical line, which has no defined slope and can’t be written in y = mx + b form — the calculator declines to show a result for that case.

Frequently asked questions

Why does a vertical line have no answer here?

A vertical line has an undefined slope, since the change in x is zero and division by zero has no meaningful result — vertical lines can’t be written in slope-intercept form at all.

What does a slope of zero mean?

A perfectly horizontal line — y stays the same no matter what x is.

What’s a practical use for this?

Finding a linear equation from two known data points, common in algebra homework and basic trend-line calculations.

Be the first to rate this

Written by

J. Adeyemi

Statistics writer

J. Adeyemi writes the statistics and probability calculators, from descriptive summaries through to distributions and conditional probability. The recurring theme is scope: each page states precisely which question it answers, because most statistical mistakes come from applying a correct formula to the wrong question. Related-but-different measures get separate pages rather than being quietly merged.

Reviewed by

T. Okafor

Calculator reviewer — mathematics

T. Okafor reviews the mathematics calculators, verifying algebraic correctness and, just as importantly, behaviour at the edges — division by zero, undefined results, and the floating-point cases where a formula technically returns a number that should be reported as undefined. Every test case is recomputed independently rather than taken on trust.

How we write and review

Related calculators