line equation calculator 2 points

Line Equation Calculator (2 Points)

Enter any two points to find the line equation instantly.

What this line equation calculator does

This tool calculates the equation of a straight line that passes through two points on the coordinate plane. If you know two coordinates like (x1, y1) and (x2, y2), the calculator will return:

  • The slope m
  • The slope-intercept form: y = mx + b
  • The point-slope form
  • The standard form: Ax + By = C

How to find a line equation from two points

Step 1: Compute the slope

Use the slope formula:

m = (y2 - y1) / (x2 - x1)

The slope tells you how steep the line is. A positive slope rises to the right, a negative slope falls to the right, and a zero slope is horizontal.

Step 2: Find y-intercept (b)

Once you have m, plug one point into y = mx + b and solve for b:

b = y1 - m(x1)

Step 3: Write the equation

With m and b known, write your line as:

y = mx + b

The calculator also gives equivalent forms, which are useful in algebra classes, SAT/ACT prep, and graphing tasks.

Example calculation

Suppose your points are (1, 2) and (4, 8).

  • Slope: m = (8 - 2) / (4 - 1) = 6/3 = 2
  • Intercept: b = 2 - (2 × 1) = 0
  • Equation: y = 2x

The calculator above performs exactly this process for any valid input values, including decimals and negative numbers.

Special cases you should know

Vertical line

If x1 = x2, the denominator in the slope formula is zero, so slope is undefined. The equation is:

x = constant

Horizontal line

If y1 = y2, then slope is zero and the equation is:

y = constant

Identical points

If both points are exactly the same, there are infinitely many possible lines through that single point. A unique line equation cannot be determined.

Why this is useful

A two-point line equation calculator helps in many contexts:

  • Algebra and analytic geometry homework
  • Graphing linear functions
  • Physics and engineering trend lines
  • Data analysis and interpolation between two observations

If you regularly work with linear equations, this is one of the fastest ways to avoid arithmetic mistakes while still understanding the underlying math.

🔗 Related Calculators