Line Equation from Two Points Calculator

Enter the coordinates of two pointsPoint P (x₁, y₁) and Point Q (x₂, y₂) — and this Line Equation from Two Points Calculator returns the slope-intercept form (y = mx + b), standard form (Ax + By + C = 0), and point-slope form of the line passing through them. You also get the slope (m) and y-intercept (b) as individual values.

Results

Slope-Intercept Form (y = mx + b)

--

Slope (m)

--

Y-Intercept (b)

--

Standard Form (Ax + By + C = 0)

--

Point-Slope Form

--

Frequently Asked Questions

What is the linear equation from two points?

The linear equation from two points describes the unique straight line that passes through both coordinates. It can be expressed in several equivalent forms: slope-intercept form (y = mx + b), standard form (Ax + By + C = 0), or point-slope form. All forms represent the same line — just written differently.

How do I find the slope-intercept line equation from two points?

First, calculate the slope using m = (y₂ − y₁) / (x₂ − x₁). Then find the y-intercept with b = y₁ − m·x₁. Substitute both values into y = mx + b to get the slope-intercept form. For example, for points (−4, 7) and (1, 2), the slope is −1 and the equation is y = −x + 3.

How do I compute the standard form linear equation from two points?

Starting from the slope-intercept form y = mx + b, rearrange to Ax + By + C = 0 by moving all terms to one side. If m = p/q is a fraction, multiply through by q to get integer coefficients. For y = −x + 3, the standard form is x + y − 3 = 0.

What is the two-point form formula?

The two-point form is (y − y₁) / (y₂ − y₁) = (x − x₁) / (x₂ − x₁). This directly uses both points to define the line without first computing the slope separately. It's equivalent to the point-slope form once the slope is substituted.

What is the equation of a line passing through (1, 1) and (3, 5)?

The slope is m = (5 − 1) / (3 − 1) = 4 / 2 = 2. The y-intercept is b = 1 − 2·1 = −1. So the slope-intercept form is y = 2x − 1, and the standard form is 2x − y − 1 = 0.

What happens if the two points have the same x-coordinate?

If x₁ = x₂, the denominator of the slope formula becomes zero, meaning the line is vertical. A vertical line cannot be expressed in slope-intercept form — instead, it's written as x = c, where c is the shared x-value. This calculator will alert you when the points form a vertical line.

What if both points are identical?

If both points are the same (x₁ = x₂ and y₁ = y₂), no unique line can be determined — infinitely many lines pass through a single point. The calculator requires two distinct points to compute a valid equation.

Can this calculator handle decimal or negative coordinate values?

Yes. You can enter any real number — including decimals like 2.5 or negative values like −7.3 — as coordinates. The calculator will compute the slope, intercept, and all equation forms with up to four decimal places of precision.

More Math Tools