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
- Enter two points on the same Cartesian plane. Use the same units and coordinate scale for both points.
- Check the units and definitions before comparing results with another source.
- 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.