line equation from two points calculator

Line Equation Calculator

Enter two points, (x1, y1) and (x2, y2), to get the line equation in slope-intercept, point-slope, and standard form.

Ready to calculate. Enter your two points and click Calculate Equation.

What this line equation from two points calculator does

This calculator finds the equation of a straight line that passes through two points on a coordinate plane. You provide two coordinates, and the tool instantly computes:

  • The slope m
  • The equation in slope-intercept form (y = mx + b)
  • The equation in point-slope form
  • The equation in standard form (Ax + By = C)

This is useful for algebra homework, SAT/ACT math prep, introductory calculus, data modeling, and quick graphing checks.

The core formula: slope from two points

Given two points (x₁, y₁) and (x₂, y₂), the slope is:

m = (y₂ - y₁) / (x₂ - x₁)

Once slope is known, plug one of the points into y = mx + b to find the y-intercept:

b = y₁ - m·x₁

Step-by-step manual method

1) Compute rise and run

Rise is Δy = y₂ - y₁ and run is Δx = x₂ - x₁. The ratio Δy / Δx gives the slope.

2) Build slope-intercept form

Use y = mx + b. Insert your slope and solve for b with either point.

3) Optional: write standard form

Rearrange terms so x and y are on the left and the constant is on the right: Ax + By = C.

Worked example

Suppose the points are (2, 5) and (6, 13).

  • Δy = 13 - 5 = 8
  • Δx = 6 - 2 = 4
  • m = 8/4 = 2
  • Use y = mx + b: 5 = 2(2) + b so b = 1

Final line equation: y = 2x + 1.

Special cases you should know

Vertical line

If x₁ = x₂, then run is zero and slope is undefined. The equation is simply x = constant.

Horizontal line

If y₁ = y₂, then rise is zero and slope is 0. The equation is y = constant.

Identical points

If both points are exactly the same, infinitely many lines pass through that single point. You need two distinct points to define one unique line.

Why multiple equation forms matter

  • Slope-intercept form helps with graphing quickly.
  • Point-slope form is best when one point and slope are known.
  • Standard form is often preferred in textbooks and systems of equations.

Common mistakes to avoid

  • Swapping x and y values accidentally
  • Forgetting parentheses when subtracting negatives
  • Dropping the sign on the slope (especially negative slopes)
  • Using the wrong point when solving for b

FAQ

Can I use decimals or negative values?

Yes. This calculator accepts integers, decimals, and negative coordinates.

Does the calculator simplify fractions?

Yes, it attempts to display slope as a simplified fraction when possible and also gives decimal values for clarity.

Can this help with graphing?

Absolutely. Once you have y = mx + b, plot the intercept b first, then use slope to move up/down and right/left.

Final takeaway

A line equation from two points is one of the most practical tools in algebra and coordinate geometry. With this calculator, you can move from raw points to a full equation instantly while still seeing the math behind the result.

🔗 Related Calculators