Equation of a Line Calculator

Find the equation of a line in slope-intercept form from two points.

⏱ Updated: 19 Sep 2026

Calculator

Free equation of a line calculator: find slope, y-intercept, and equation from two points.

Equation
Slope
Y-Intercept

Enter two points to calculate the slope, y-intercept, and equation of the line through them.

How to Use the Equation of a Line Calculator

Enter the coordinates of two points on the line. The slope, y-intercept, and full equation come out below.

slope (m) = (y2 − y1) ÷ (x2 − x1)
y-intercept (b) = y1 − m × x1
equation: y = mx + b

Two points are always enough to pin down exactly one line — the slope formula measures how steeply it rises between them, and plugging that slope back into either point isolates where the line would cross the y-axis. The one case this breaks is a vertical line (x1 equals x2), where the slope formula divides by zero; a vertical line's equation is simply x = that shared x-value, and this calculator flags that case rather than reporting an undefined slope as if it were a number.