Skip to content
D DocNectar

Free Line Equation Calculator

Find the slope-intercept equation of a line from any two points.

100% Free No Signup Works on all devices

Built and fact-checked by the DocNectar team — see our editorial standards

Thanks for rating!

Key Features

Instant Calculation

Get accurate results in real time with our optimized algorithm.

Mobile Friendly

Fully responsive design. Works on all devices & screen sizes.

Privacy Focused

Your data stays on your device. We don't store any inputs.

100% Free

No hidden costs. This tool is completely free forever.

Any two distinct points determine exactly one straight line, and that line's equation can be found directly from their coordinates.

This calculator finds the slope-intercept equation of the line through any two given points.

How it works

Enter the coordinates of two points. The calculator computes the slope between them, then uses point-slope form to solve for the y-intercept, producing the final equation in y = mx + b form (or x = constant for a vertical line).

  1. Enter point 1 — x.
  2. Enter point 1 — y.
  3. Enter point 2 — x.
  4. Enter point 2 — y.
  5. Click Calculate to see your results.

Examples

(1,2) and (3,6)

The line through (1,2) and (3,6) has the equation y = 2x + 0, since the slope is 2 and the line passes through the origin.

Who should use it

  • Finding the equation of a line for algebra or coordinate geometry coursework.
  • Checking a hand-derived line equation from two known points.

Industry applications

  • Algebra and geometry education
  • Data analysis (linear trends between two data points)

Advantages

  • Automatically handles the vertical-line special case instead of failing on it.
  • Shows both the slope and y-intercept as separate results alongside the full equation.

Limitations

  • Outputs slope-intercept form only, not standard form (Ax + By = C) or point-slope form.

Common mistakes to avoid

  • Entering the same point twice, which doesn't define a unique line (division by zero in the slope formula).
  • Mixing up which coordinate is x and which is y when entering the two points.

Best practices

  • Verify the resulting equation by plugging both original points back in and confirming they satisfy y = mx + b.

Tips

  • If you only need the rate of change between two points (not the full equation), the site's Slope Calculator gives just that value directly.

Frequently asked questions

Yes, with no signup and no limit on how many calculations you run.
A vertical line (where both points share the same x-coordinate) has an undefined slope, so the calculator instead reports the equation as x = (that constant x-value).
It measures how steep the line is and its direction — positive slopes rise left to right, negative slopes fall, and a slope of 0 means a horizontal line.
It's the point where the line crosses the y-axis (where x = 0) — the constant b in the y = mx + b equation.

Get new calculators and guides in your inbox

No spam — just new tools like Line Equation Calculator and practical guides.

Favorites