Equation of a Line Calculator
Write the equation of the line through two points in slope-intercept, point-slope and standard form, with the second point substituted back as the check.
Equation of a Line Calculator
Write the equation of the line through two points in slope-intercept, point-slope and standard form, with the second point substituted back as the check.
How this page computes
The slope comes from the coordinate differences and the intercept from one point. The three forms are rearrangements of y = mx + b, written with the computed values.
The x-intercept solves the slope-intercept form for y = 0, and the check substitutes the second point into the equation. A zero run produces the vertical form only.
The calculation runs entirely in this browser tab; nothing is uploaded.
Two points determine one line, and the page writes it in three forms. Through (1, 2) and (3, 8) the slope is 3, so the line is y = 3x − 1 in slope-intercept form, y − 2 = 3(x − 1) in point-slope form, and −3x + y = −1 in standard form.
Each form is the same line rearranged, and the page substitutes the second point back into the equation as the check. A vertical pair of points is written x = constant, with the missing forms named as missing.
How to use Equation of a Line Calculator
Enter both points and press Run. Two identical points are refused, since they determine no line.
The output gives the slope, the y-intercept, the three forms, the x-intercept and the substitution check. A vertical line prints only its own form and says why the others do not exist.
Why there are three forms and not one
Slope-intercept form shows the slope and the value at x = 0, which is what a graph reader wants. Point-slope form shows where the line was measured from, which is what a derivation wants. Standard form puts both variables on one side, which is what a linear system wants.
Converting between them is rearrangement, so the page computes the slope once and derives the rest from it. The check substitutes the second point, which catches a sign error in any of the three.
What to Expect
Best for
- The equation of the line through two points
- Any of the three standard forms
- A linear equation to put into a system solver
Not ideal for
- A line given as a slope and a point, which the slope-intercept page takes
- A curve through two points, which is underdetermined
- A vertical pair, where only one form exists
What this tool keeps
- Both points exactly as typed
What may need cleanup
- Nothing: the forms are the same line
Common errors
- Identical points are refused
- A vertical line reports the missing forms instead of fabricating them
Example use cases
- Write the line through (1, 2) and (3, 8)
- Get standard form for a linear system
- See a vertical line through (2, 1) and (2, 9)
Sample input
(1, 2) and (3, 8)
Sample output
y = 3x - 1, y - 2 = 3(x - 1), -3x + y = -1
Who this is for
- Students writing a line equation
- Readers setting up a linear system
Frequently asked questions
Which form should I use?
Whatever the next step needs. A graph wants slope-intercept, a derivation wants point-slope, and a system wants standard form. All three are printed because the line is the same.
Why is the standard form negative?
Because moving y to the left gives −mx + y = b. Multiplying by −1 gives mx − y = −b, which is the same line; the page prints the direct rearrangement so the step is visible.
What if the two points have the same x?
The line is vertical and its equation is x = constant. It has no slope and no y-intercept, so the page prints only that form and names the others as non-existent.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.