What this calculator does
Three forms describe the same line, and each is convenient for something different. Slope-intercept shows the gradient and where the line crosses the y-axis; point-slope is what you write down first from two points; standard form handles vertical lines that slope-intercept cannot.
Everything follows from the slope. Two points at (1, 2) and (4, 11) give a slope of 3.000, which produces y = 3.000x − 1.000 and every other form from there.
The formula
The slope is the change in y over the change in x. Substituting one point gives the y-intercept, and rearranging produces the other forms.
| Term | Meaning |
|---|---|
| Slope-intercept form | y = mx + b, showing gradient and y-intercept directly. |
| Point-slope form | y − y₁ = m(x − x₁), the form that falls out of two points immediately. |
| Standard form | Ax + By = C, which can represent vertical lines. |
The inputs explained
| Field | What to enter |
|---|---|
| x₁ | x coordinate of the first point. |
| y₁ | y coordinate of the first point. |
| x₂ | x coordinate of the second point. |
| y₂ | y coordinate of the second point. |
When to use it
Finding a line through two points
The most common line problem there is.
Converting between forms
Different contexts want different forms of the same line.
Finding where a line crosses the axes
Both intercepts follow from the equation.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How does the second point change the line?
The same first point with three different second points.
| Second point y | Slope (m) | Slope-intercept form |
|---|---|---|
| (4, 5) | 1.000 | y = 1.000x + 1.000 |
| (4, 11) | 3.000 | y = 3.000x − 1.000 |
| (4, 20) | 6.000 | y = 6.000x − 4.000 |
Questions
Why can a vertical line not be written as y = mx + b?
Because its slope is undefined: the run is zero, so the division fails. A vertical line is written x = constant, which the standard form Ax + By = C accommodates by setting B to zero.
What does a slope of zero mean?
A horizontal line. The y value never changes, so there is no x-intercept unless the line is the x-axis itself, in which case every point is an intercept.
Does the order of the points matter?
No. Swapping them negates both the numerator and the denominator of the slope, which cancels. The same line results either way.
How do I find a perpendicular line?
Take the negative reciprocal of the slope. A line with slope 3 has perpendiculars with slope −1/3, since the product of perpendicular slopes is always −1 for non-vertical lines.
For the distance from a point to a line, see the point to line distance calculator. For where a line meets a circle, see the circle line intersection calculator.