A straight line can be written several different ways, and each form is useful for a different job. This calculator converts freely between the three most common forms so you can see slope, intercepts, and coefficients side by side, whichever way your textbook or problem states the line.

Why three different forms?

Slope-intercept form (y = mx + b) is the easiest to graph โ€” the slope and starting height are both visible at a glance. Point-slope form (y - y1 = m(x - x1)) is the fastest to write down the moment you know a slope and a single point, without solving for the y-intercept first. Standard form (Ax + By = C) clears any fractions out of the slope and is the form most systems-of-equations and linear-algebra techniques expect.

From two points to a slope

Given two points (x1, y1) and (x2, y2), the slope is the change in y divided by the change in x: m = (y2 - y1) / (x2 - x1). Once you have the slope, plug either point back into y = mx + b and solve for b โ€” that is exactly what this calculator does internally, whichever mode you start from.

The vertical-line exception

If both points share the same x-value, the denominator in the slope formula becomes zero and the slope is undefined, not zero. A vertical line cannot be written as y = mx + b or in point-slope form at all โ€” its only equation is x = c, where c is the shared x-value. A horizontal line is the opposite edge case: the slope is exactly 0, and its equation simplifies to y = b.

Parallel and perpendicular lines

Two lines are parallel when they share the same slope m โ€” they never meet because they rise and run at exactly the same rate. Two lines are perpendicular when their slopes are negative reciprocals of each other (m and -1/m) โ€” for example, a line with slope 2 is perpendicular to one with slope -1/2. Vertical and horizontal lines are always perpendicular to each other.

Reading intercepts

The x-intercept is where a line crosses the horizontal axis โ€” the point where y = 0. The y-intercept is where it crosses the vertical axis โ€” the point where x = 0. Setting one variable to zero and solving for the other in any of the three forms gives you both intercepts directly, which this calculator does automatically on the Intercepts tab.