Equation of a Line Calculator

Find the equation of a line through two points in slope-intercept, point-slope, and standard forms.

Share this calculator

Point 1

Point 2

Result

y = 0.5x

Equation of the line in slope-intercept form.

Slope (m)
0.5
Y-intercept (b)
0
X-intercept
0
Distance
4.47

Standard form

x - 2y = 0

Point-slope form

y - 0 = 0.5(x - 0)

Also in Functions

Algebra

Equation of a line through two points

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.

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.

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.

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.