Find the equation of a straight line (slope-intercept, point-slope, and standard form) from two points.
📖 Slope-Intercept & Point-Slope Line EquationsFill in the fields on the left with your information, then press Calculate to see your result instantly. No sign-up required, and no data is sent anywhere — everything is calculated right in your browser.
The linear equation calculator finds the complete equation of a straight line just by knowing two points it passes through. The calculator first calculates the slope (m) by dividing the difference in y by the difference in x between the two points, then uses it to find the line's y-intercept. The result is displayed in three different commonly used forms: slope-intercept form: y = mx + b, the most commonly used for quick graphing; point-slope form: y − y₁ = m(x − x₁), useful when knowing one point and the slope directly; and standard form, useful in solving linear systems. If the two points' x-values are identical, the line is perfectly vertical and has no defined slope, so its equation is simply displayed as x = constant. Each of these three forms describes exactly the same line, so the choice between them in a given problem is purely a matter of which form makes the next step of that particular problem easiest.
A single straight line can be written in several algebraically different but mathematically equivalent equations, and understanding why each form exists — rather than treating them as three unrelated things to memorize — makes switching between them far more intuitive.
Slope-intercept form, y = mx + b, is built for reading information directly off the equation at a glance: m is the slope, and b is the y-intercept, the exact point where the line crosses the vertical axis. This makes slope-intercept form the fastest to graph by hand — plot the y-intercept, then use the slope to find a second point — which is why it is usually the first form introduced and the most commonly used for everyday graphing.
Point-slope form, y − y₁ = m(x − x₁), is built for a different situation: when a specific point on the line and the slope are both known, but the y-intercept has not yet been calculated. Rather than solving for the y-intercept first and then writing slope-intercept form, point-slope form lets the equation be written immediately from the given point and slope, and can always be algebraically rearranged into slope-intercept form afterward if needed.
Standard form, typically written as Ax + By = C, is built for a different purpose again: it is the form most convenient for solving systems of two or more linear equations simultaneously, particularly using elimination methods where matching coefficients between equations makes canceling a variable straightforward. Standard form does not display the slope or intercept directly, but it is often the most convenient starting point for further algebraic manipulation involving multiple equations at once.
The vertical line special case deserves its own attention: because slope is undefined for a vertical line (division by zero when the two x-coordinates are identical), a vertical line cannot be written in slope-intercept or point-slope form at all — it must be written simply as x equals a constant value, describing every point sharing that same x-coordinate regardless of y.
Finding a line's equation from two known points is a routine task across science and engineering whenever a relationship is assumed to be linear: converting between two temperature scales, modeling a steady rate of change over time from just two measured data points, or establishing a calibration line between a sensor's raw output and its real-world measured value.
It's the most common form for graphing a line quickly, since 'm' gives the steepness and 'b' gives exactly where the line crosses the y-axis.
Each form is more convenient in different situations — point-slope is easiest right after finding two points, while standard form is often preferred for solving systems of equations.
That means the line is perfectly vertical, which has no defined slope, so the equation is simply written as x equals that constant value.