Line Equation Analyzer

Give two points — or a slope with a point or intercept — and get the slope, intercepts, and the line in slope-intercept, point-slope and standard form, drawn to scale.

How to Find the Equation of a Line

Start from two points, a slope and a point, or a slope and an intercept. The analyzer finds the slope and writes the line in all three common forms.

1

Find the slope

From two points (x₁, y₁) and (x₂, y₂) the slope is m = (y₂ − y₁) / (x₂ − x₁), the rise over the run. With whole-number points the analyzer keeps the slope as an exact fraction, so you see 2/3 rather than 0.6667.

2

Write the line in each form

Point-slope form is y − y₁ = m(x − x₁). Solving for y gives slope-intercept form y = mx + b, where b is where the line crosses the y-axis. Clearing fractions and moving everything to one side gives standard form Ax + By = C.

3

Find the intercepts and graph it

The y-intercept is b, and the x-intercept is where y = 0, at x = −b/m. Horizontal lines (m = 0) have no x-intercept unless they are the x-axis itself, and vertical lines (x = a) have an undefined slope, so the analyzer reports those as special cases.

Frequently Asked Questions

How do you find the equation of a line through two points?
Compute the slope from the two points, then substitute either point into y − y₁ = m(x − x₁). Through (1, 2) and (4, 8), m = 6/3 = 2, so y − 2 = 2(x − 1), which simplifies to y = 2x.
What is the difference between slope-intercept and standard form?
Slope-intercept form y = mx + b shows the slope and y-intercept directly, which makes graphing quick. Standard form Ax + By = C uses whole numbers and handles vertical lines, which slope-intercept form cannot write.
What does an undefined slope mean?
It means the line is vertical: both points share the same x value, so the run is zero and the division is impossible. The equation of a vertical line is simply x = a.
How do you find the x-intercept of a line?
Set y = 0 and solve for x. For y = 2x − 6, 0 = 2x − 6 gives x = 3, so the line crosses the x-axis at (3, 0).