The equation of a line calculator finds the linear equation passing through two given points. It outputs the result in slope-intercept form, point-slope form, and standard form, along with the slope and intercepts.
How the equation is derived
Given two points (x1, y1) and (x2, y2), the slope m is calculated as (y2 - y1) / (x2 - x1). With the slope known and one point on the line, the equation can be written in point-slope form and then converted to slope-intercept or standard form.
If x1 equals x2 the line is vertical and has no finite slope. The equation is simply x = x1. Vertical lines cannot be expressed in slope-intercept form.
m = (y2 - y1) / (x2 - x1)
Slope from two points. This is the specific relationship the calculator applies when building the result.
y = mx + b
Slope-intercept form, where b is the y-intercept.
Forms of a linear equation
Slope-intercept form (y = mx + b) is the most common. Point-slope form (y - y1 = m(x - x1)) is useful when you know a point and the slope. Standard form (Ax + By = C) is used in systems of equations and has integer coefficients by convention.
Worked example and interpretation
A worked example helps translate the equation of a line through two points maths into a realistic scenario so the user can compare the headline result with a concrete set of inputs.
That matters because a result is easier to trust when the page shows how the same logic behaves in a practical case instead of leaving the formula abstract.
Frequently asked questions
What if both points are the same?
If both points are identical, infinitely many lines pass through that single point. The calculator needs two distinct points to determine a unique line.
How do I convert between forms?
From point-slope form, distribute and solve for y to get slope-intercept form. From slope-intercept form, rearrange terms so that x and y are on one side and the constant is on the other to get standard form.
How can I check the equation of a line through two points result manually?
The safest manual check is to follow the same formula or rule one step at a time and compare that working with the calculator output. That catches sign errors, bracket mistakes, and input-order mixups without requiring any extra method beyond the underlying maths itself.