Slope-Intercept Form Calculator

Enter two points, a point and a slope, or a line equation. Get y = mx + b, point-slope form, standard form, both intercepts, distance, angle, and a full graph.

First point (x₁, y₁)
Second point (x₂, y₂)

What does slope-intercept form tell you?

The equation y = mx + b packs two facts about a straight line into two numbers:

  • m — the slope. How steep the line is, and which way it tilts. A positive m rises left-to-right, a negative m falls, and m = 0 is flat.
  • b — the y-intercept. Where the line crosses the y-axis, at (0, b).

Slope-intercept form, piece by piece

From two points to y = mx + b

Slope m is the rise over the run between the two points. The intercept b comes from plugging either point into y = mx + b and solving.

m = (y₂ − y₁)/(x₂ − x₁) · b
= y₁ − m·x₁
runrise
Example
Given
(1, 2) and (4, 11)
Substitute
m = 9/3
= 3 · b
= 2 − 3·1
Answer
y = 3x − 1

Three ways to write the same line

Slope-intercept, point-slope, and standard form describe the same line rearranged. The calculator shows all three — pick whichever your problem uses.

y = mx + b ⇔ y − y₁
= m(x − x₁) ⇔ Ax + By
= C
y = mx + by − y₁ = m(x − x₁)Ax + By = C
Example
Given
y = 3x − 1
Substitute
y − 2 = 3(x − 1)
Answer
3x − y = 1

Vertical lines don't fit y = mx + b

When x₁ = x₂ the slope formula divides by zero. The calculator reports the line as x = constant instead of pretending m exists.

x₁ = x₂ ⇒ line is x
= x₁ (slope undefined)
x = 3slope undefined
Example
Given
(3, 1) and (3, 7)
Substitute
same x on both points
Answer
x = 3

Features of this calculator

  • Three input modes: two points, one point + slope, or a line equation (y = mx + b or Ax + By = C)
  • Computes slope m, y-intercept b, and x-intercept (with a clean note when the line is horizontal)
  • For two-point input, also shows distance between the points and the angle of incline in degrees and radians
  • Shows the same line in point-slope form and standard (Ax + By = C) form with a proper rational approximation — no huge ugly numbers for slopes like 4/3 or 1/6
  • Detects vertical lines (x₁ = x₂) and explains why they can't be written as y = mx + b
  • Interactive SVG graph with both intercepts marked in distinct colors
  • Full step-by-step working laid out in named sections: Answer, Point-Slope, Slope-Intercept expansion, Y-Intercept, X-Intercept, Graph, Standard Form

Frequently asked questions

+What does a slope of zero mean?

Zero slope means the line is perfectly horizontal — y never changes as x moves. The equation collapses to y = b.

+What does undefined slope mean?

Undefined slope happens when the two points sit on a vertical line (x₁ = x₂). The slope formula divides by zero. Such lines are written x = constant instead of y = mx + b.

+Does it matter which point I call (x₁, y₁)?

No. Swap them and both numerator and denominator of the slope formula change sign, so m is unchanged.

+How do I convert to standard form?

Starting from y = mx + b, move mx to the left to get −mx + y = b, then multiply through by a common factor so A, B, and C are integers and A ≥ 0.

Related calculators