equations of a line calculator

Line Equation Solver (From Two Points)

Enter any two distinct points. The calculator returns slope-intercept form, point-slope form, standard form, intercepts, midpoint, and more.

What this equations of a line calculator does

This calculator helps you find every major form of a linear equation from two points on a coordinate plane. If you already know two points, you can quickly compute the slope and instantly write the line in slope-intercept form, point-slope form, and standard form.

It also handles special situations that often cause mistakes in algebra classes: vertical lines (undefined slope), horizontal lines (zero slope), and cases where intercepts are missing or infinite.

How to use it

Step 1: Enter two points

Fill in values for x₁, y₁ and x₂, y₂. These can be integers or decimals.

Step 2: Click “Calculate Equation”

The calculator computes all key outputs immediately. If your points are identical, it will show an error because one point alone does not define a unique line.

Step 3: Read the equation forms

  • Slope-intercept form: y = mx + b
  • Point-slope form: y - y₁ = m(x - x₁)
  • Standard form: Ax + By = C

Quick refresher: the core line formulas

1) Slope formula

The slope between two points is:

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

If x₂ - x₁ = 0, slope is undefined and the line is vertical.

2) Slope-intercept form

Once slope is known, find the y-intercept with:

b = y₁ - mx₁

Then write the line as y = mx + b.

3) Point-slope form

Use either known point:

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

This form is often fastest when solving homework problems manually.

4) Standard form

Standard form is written as Ax + By = C. Many teachers prefer integer coefficients when possible. This calculator generates a clean standard-form equation directly from the two points.

Special cases this calculator handles

  • Vertical line: equation is x = constant; slope is undefined.
  • Horizontal line: equation is y = constant; slope is 0.
  • Coincident input points: no unique line exists; calculator prompts for different points.

Why this is useful for students and teachers

Line equations appear in algebra, coordinate geometry, physics, economics, and data science. A reliable equations of a line calculator saves time and lets you focus on interpretation rather than arithmetic.

Teachers can use it to create answer keys quickly. Students can use it to check classwork and understand how one set of points translates into multiple equivalent line forms.

Common mistakes to avoid

  • Switching point order in numerator and denominator inconsistently.
  • Forgetting that dividing by zero means undefined slope (vertical line).
  • Sign errors when converting from point-slope to slope-intercept form.
  • Treating x = 4 as if it had a y-intercept (it does not have a single one).

Practice examples

Example A

Points: (1, 3) and (5, 11) Slope: m = (11 - 3) / (5 - 1) = 2 Equation: y = 2x + 1

Example B

Points: (2, -4) and (2, 7) Since x-values match, the line is vertical: x = 2

Final thoughts

Whether you are reviewing for an exam or building intuition in analytic geometry, this tool gives you fast and accurate results. Enter two points, compare equation forms, and strengthen your understanding of how linear relationships work.

🔗 Related Calculators