Home · Math · Algebra · Line Equation from Two Points Calculator

Line Equation from Two Points Calculator

The line through two points: its slope, its y-intercept in y = mx + b form, and the midpoint of the pair.

Your figures

Example result — edit the figures to make it yours

2

Slope m

y-intercept b0.00
Midpoint x2.00
Midpoint y4.00

What this calculator does

The line through two points: its slope, its y-intercept in y = mx + b form, and the midpoint of the pair. Every figure on this page is computed from the formula or definition stated below, with no hidden rounding steps, and the method notes name the exact convention where more than one exists.

The formula and method

Slope m = (y2 − y1) ÷ (x2 − x1); b = y1 − m · x1

The slope is the rise over the run between the points; the intercept then follows from either point. The two x values must differ (a vertical line has no slope-intercept form).

Worked example

With the example inputs this page opens with (x1 1, y1 2, x2 3, y2 6), the result is 2.00 — slope m. Change any figure and the result updates with the same formula.

Quick reference

Quick reference — varying x1
x1Slope m
0.51.60
0.81.82
12.00
1.252.29
1.52.67
24.00

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

How does the Line Equation from Two Points Calculator work?

The line through two points: its slope, its y-intercept in y = mx + b form, and the midpoint of the pair. Points (x1, y1), (x2, y2) → Slope, y-intercept, midpoint. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the Line Equation from Two Points Calculator need?

Points (x1, y1), (x2, y2) → Slope, y-intercept, midpoint. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.

Is the Line Equation from Two Points Calculator free to use?

Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.