Equation of the Line That Passes Through the Points Calculator

This equation of the line that passes through the points calculator gives the slope, slope-intercept form, point-slope form and standard form from any two points.

Checks on your data

  • Slope and intercept were computed with exact fractions.
  • Check by substituting each point into the equation. Both must satisfy it.
  • For many points that do not lie on one line, use regression instead of a line through two points. Open the regression calculator →

Results

Equation (slope-intercept form)
y = 2x
Slope m
2
rise 6 over run 3
y-intercept b
0
Point-slope form
y − 2 = 2(x − 1)
Standard form
2x − y = 0
x-intercept
0
Distance between the points
6.7082
Midpoint
(2.5, 5)
Angle with the x-axis
63.435°
Line through (1, 2) and (4, 8)
24681234xy
Show step-by-step solution
  1. Slope m = (y₂ − y₁) ÷ (x₂ − x₁) = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2.
  2. Use the point (1, 2) in y = mx + b: 2 = 2 × 1 + b, so b = 0.
  3. The line is y = 2x.
  4. In standard form: 2x − y = 0.
Slopem = (y₂ − y₁)/(x₂ − x₁)
Slope-intercepty = mx + b
Point-slopey − y₁ = m(x − x₁)

What Is Equation of the Line That Passes Through the Points?

Two different points determine exactly one straight line. To find its equation, compute the slope (y₂ − y₁) ÷ (x₂ − x₁), then use either point to find the y-intercept in y = mx + b.

Enter the coordinates of the two points. The calculator returns the slope as an exact fraction, the equation in slope-intercept, point-slope and standard forms, the x-intercept, the distance between the points, their midpoint and a graph with the line drawn through them.

If the two x values are equal, the line is vertical and the slope is undefined, so the equation is x = a constant. If the two y values are equal, the line is horizontal and the slope is 0.

How to Use the Equation of the Line That Passes Through the Points Calculator

  1. Enter the coordinates of the two points.
  2. Read the slope and the equation in three forms.
  3. Check by substituting both points.

Equation of the Line That Passes Through the Points Formula

Slope

m=y2−y1x2−x1m=\frac{y_2-y_1}{x_2-x_1}

Slope-intercept form

y=mx+b,b=y1−mx1y=mx+b,\quad b=y_1-mx_1

Point-slope form

y−y1=m(x−x1)y-y_1=m(x-x_1)

Standard form

Ax+By=CAx+By=C

Equation of the Line That Passes Through the Points Variables Explained

SymbolMeaningNotes
(x₁, y₁), (x₂, y₂)The two points
mSlope, rise over run
by-intercept, where the line crosses the y-axis
Ax + By = CStandard form of a lineUsually whole numbers

Equation of the Line That Passes Through the Points Worked Example

With the example values loaded in the calculator above, the steps are:

  1. Slope m = (y₂ − y₁) ÷ (x₂ − x₁) = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2.
  2. Use the point (1, 2) in y = mx + b: 2 = 2 × 1 + b, so b = 0.
  3. The line is y = 2x.
  4. In standard form: 2x − y = 0.

Result: Equation (slope-intercept form) = y = 2x; Slope m = 2.

Worked example: (1, 2) and (4, 8)

The slope is (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. Using (1, 2): 2 = 2 × 1 + b, so b = 0.

The line is y = 2x. In point-slope form it is y − 2 = 2(x − 1), and in standard form 2x − y = 0.

Vertical and horizontal lines

If the two x values are equal, the line is vertical and the slope is undefined. The equation is x = a number. If the two y values are equal, the slope is 0 and the line is horizontal: y = a number.

Where Equation of the Line That Passes Through the Points Is Used

Algebra homework

Write the line through two given points in the form your teacher asks for.

Graphing

Get the intercepts and slope to sketch a line quickly.

Interpolation

Estimate a value between two measurements using the line joining them.

Common Equation of the Line That Passes Through the Points Mistakes to Avoid

  • Keep the slope as a fraction while calculating to avoid rounding.
  • Standard form is usually written with whole number coefficients and a positive x coefficient.

Equation of the Line That Passes Through the Points Terms and Definitions

Slope
The rise divided by the run between two points on a line.
Intercept
Where the line crosses an axis.

Equation of the Line That Passes Through the Points FAQs

How do you find the equation of a line through two points?

Compute the slope (y₂ − y₁) ÷ (x₂ − x₁), then use one point to solve y = mx + b for b.

What if the x values are the same?

The line is vertical with equation x = that value, and the slope is undefined.

What is point-slope form?

y − y₁ = m(x − x₁), built directly from the slope and one point.

What is standard form?

Ax + By = C, usually with whole number coefficients and A positive.

How do I find the x-intercept?

Set y = 0 and solve: x = −b ÷ m.

How can I check my equation?

Substitute both points. Each must make the equation true.

Related calculators

Last updated 2026-11-09. See our disclaimer.