Skip to content
Math & Stats

Equation of a Line Calculator

Find the equation of a line from two points or a point and slope. Get slope-intercept, point-slope, standard form, plus x and y intercepts.

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

Enter points or point+slope and click Calculate

Line Equation Formulas
Slope: m = (y₂ − y₁) / (x₂ − x₁)
Slope-Intercept: y = mx + b
Point-Slope: y − y₁ = m(x − x₁)
Standard Form: Ax + By = C
x-intercept: x = −b/m (set y=0)
y-intercept: y = b (set x=0)

FAQ

Frequently asked questions about line equations

What is slope-intercept form?
Slope-intercept form is y = mx + b, where m is the slope (rise/run) and b is the y-intercept (where the line crosses the y-axis). It's the most intuitive form for graphing and understanding linear relationships.
What is point-slope form?
Point-slope form is y − y₁ = m(x − x₁), where m is the slope and (x₁, y₁) is a known point on the line. It's useful when you know the slope and one point but not the y-intercept.
What is standard form of a line?
Standard form is Ax + By = C, where A, B, and C are integers with A ≥ 0. If A = 0, then B > 0. This form is useful for finding intercepts quickly and for systems of equations.
How do I find slope from two points?
Slope m = (y₂ − y₁) / (x₂ − x₁). This gives the rate of change: how much y changes for each unit change in x. A positive slope goes up-right, negative goes down-right, zero is horizontal.
What if the line is vertical?
A vertical line has undefined slope (x₁ = x₂, making the denominator zero). Its equation is simply x = c (a constant). Vertical lines cannot be written in slope-intercept form.
How do I find x-intercept and y-intercept?
The y-intercept is found by setting x = 0 in the equation (it's the 'b' in y = mx + b). The x-intercept is found by setting y = 0 and solving for x: x = -b/m.

Related calculators