Home / Line Equation Calculator

Line Equation Calculator

The line-equation calculator finds the slope, y-intercept and equation of the straight line through two distinct Cartesian points.

How to use this calculator

  1. Enter two points on the same Cartesian plane. Use the same units and coordinate scale for both points.
  2. Check the units and definitions before comparing results with another source.
  3. Change one input at a time when comparing scenarios, and keep the reporting period and assumptions consistent.

Formula used by the line equation calculator

m = (y₂ − y₁)/(x₂ − x₁); b = y₁ − mx₁; y = mx + b

  • m = (y₂ − y₁)/(x₂ − x₁); b = y₁ − mx₁; y = mx + b
  • Two identical points do not determine a unique line. A vertical line has an undefined slope and is represented by x = a constant.
  • Inputs are checked for required values and valid ranges; displayed results are rounded for readability.

Worked examples

Worked example

Points (0, 2) and (2, 6).

The slope is (6−2)/(2−0) = 2, the y-intercept is 2, and the equation is y = 2x + 2.

The slope is (6−2)/(2−0) = 2, the y-intercept is 2, and the equation is y = 2x + 2.

Understanding the result

The line-equation calculator finds the slope, y-intercept and equation of the straight line through two distinct Cartesian points.

Two identical points do not determine a unique line. A vertical line has an undefined slope and is represented by x = a constant.

Important notes

Two identical points do not determine a unique line. A vertical line has an undefined slope and is represented by x = a constant.

The result applies to the numbers and assumptions entered here; verify specifications for safety-critical or regulated uses.

Frequently asked questions

What if both x coordinates match?

The line is vertical and the equation is x = that shared coordinate.

Can the slope be negative?

Yes. A negative slope means y decreases as x increases along the line.

How do I use this calculator?

Enter two points on the same Cartesian plane. Use the same units and coordinate scale for both points.

Affiliate recommendations

Tools related to Line Equation Calculator

These tools are selected for the calculator topic. The Calc Studio may earn a commission from purchases made through affiliate links.

  • Growth Wise SAT & ACT prep Visit partner ↗

    SAT and ACT study tools, flashcards, and preparation resources for students.

See the Affiliate Disclosure for details.

Related calculators

  • Slope Calculator — Calculate the slope between two points on a line.
  • Percentage Point Change Calculator — Calculate the percentage-point difference between two percentages and the relative percentage change.
  • Two-Proportion Z-Test Calculator — Compare two independent success proportions using a pooled z statistic and a two-sided normal approximation.
  • 2×2 Matrix Calculator — Add, subtract and multiply 2×2 matrices and calculate each determinant with transparent row and column inputs.
  • Linear Regression Calculator — Fit a simple least-squares line to paired x and y data and estimate a y value for a chosen x.
  • Circle Calculator — Calculate circle area, circumference, and diameter from radius.

Related explanations

Learn the method behind the number or compare the terminology before using the calculator.

  • How to Calculate a Z-Score — Learn how a z-score shows how far a value is from the mean in standard-deviation units.
  • How to Calculate Break-Even Point — Learn the break-even formula for units and revenue and understand fixed costs, price, and variable costs.
  • Slope — Learn what slope means and how to calculate the slope between two points.

This page provides a calculation tool plus explanatory information so you can understand what the result means and when the underlying method may not fit your situation.

Explore more calculation resources

Keep exploring related tools, explanations, conversions, and topic pages in The Calc Studio. These links are selected around the subject of this page so you can move to the next useful calculation without returning to search.

Related calculators

  • Slope Calculator — Calculate the slope between two points on a line.
  • Linear Regression Calculator — Fit a simple least-squares line to paired x and y data and estimate a y value for a chosen x.
  • Coordinate Midpoint Calculator — Find the midpoint and straight-line distance between two points on a Cartesian plane.
  • Distance Calculator — Calculate straight-line distance between two points on a coordinate plane.
  • Percentage Point Change Calculator — Calculate the percentage-point difference between two percentages and the relative percentage change.
  • Two-Proportion Z-Test Calculator — Compare two independent success proportions using a pooled z statistic and a two-sided normal approximation.
Browse by categoryMath CalculatorsBusiness CalculatorsFinancial CalculatorsDate & Time CalculatorsEveryday ToolsHealth & Fitness Calculators

Task collections

  • Math & Statistics Calculators — Free math and statistics calculators for Bayes theorem, set operations, matrices, complex numbers, vector products, normal distributions, averages, percentages, standard deviation, geometry, equations, and number systems.
  • Calculators for Students — Free student calculators for grades, percentages, fractions, probability, normal distributions, matrices, vectors, complex numbers, statistics, geometry, and scientific math.
  • Business & Work Calculators — Free business and work calculators for ROI, markup, break-even, sales commission, DSO/DPO, customer-acquisition payback, weighted sales pipelines, labour cost per unit, FTE staffing, email growth, and creator RPM.
  • Time & Date Calculators — Free time and date calculators for age, date differences, date arithmetic, business days, time duration, time zones, and countdowns.

Related guides

  • How to Calculate a Z-Score — Learn how a z-score shows how far a value is from the mean in standard-deviation units.
  • How to Calculate Age from a Date of Birth — Learn how exact age is calculated using years, months, and days rather than a rough year difference.
  • How to Calculate Break-Even Point — Learn the break-even formula for units and revenue and understand fixed costs, price, and variable costs.

Related terms

  • Slope — Learn what slope means and how to calculate the slope between two points.
  • Markup — Learn what markup means, how markup is calculated from cost and selling price, and how it differs from margin.
  • Break-Even Point — Understand break-even point, contribution margin, and the basic unit break-even formula.

Useful conversions

  • °C to °F — Convert Celsius to Fahrenheit with a free temperature converter, formula, examples, and common temperatures.
  • °F to °C — Convert Fahrenheit to Celsius with a free temperature converter, formula, examples, and common temperatures.
  • cm to feet — Convert centimeters to feet with a free cm to feet converter, formula, examples, and a quick reference table.

Browse all calculators · Read all guides · Open the glossary · See all converters · Browse collections

Want to keep learning? Move from a calculator to its formula guide, glossary definition, unit conversion, or task collection to compare related methods and tools.

Optional Premium: save calculation history across visits and remove promotional blocks. See Premium.