InfyCalculator
➗

Slope Intercept Form Calculator

Find the equation of a line in slope-intercept form y = mx + b from two points, a point and a slope, or standard form Ax + By = C — with exact fractions, point-slope and standard forms, both intercepts, the angle, a graph and every step worked out.

What do you know?
x₁
y₁
x₂
y₂
Slope m
Y-intercept b
A (number in front of x)
B (number in front of y)
C (number on the right)
Find y at x =
Loading calculator…

How it works

m = (y₂ − y₁) ÷ (x₂ − x₁) · b = y₁ − m · x₁ · y = mx + b · point-slope: y − y₁ = m(x − x₁) · standard Ax + By = C ⇒ m = −A ÷ B, b = C ÷ B · x-intercept = −b ÷ m · angle θ = arctan(m) · perpendicular slope = −1 ÷ m

Slope-intercept form, y = mx + b, describes any non-vertical line by two numbers: the slope m, how steeply it climbs, and the intercept b, where it crosses the y-axis. From two points, the slope is the rise (y₂ − y₁) over the run (x₂ − x₁); substituting one point back into y = mx + b gives b. From a point and a slope, the same substitution gives b directly. From standard form Ax + By = C, solving for y gives m = −A ÷ B and b = C ÷ B. The calculator keeps exact fractions throughout — decimals you type are treated as exact (0.25 = 1/4) — so a slope like 2/3 is not rounded to 0.6667. It also writes the line in point-slope, standard (whole-number coefficients, A positive) and general form, finds both intercepts, the angle with the x-axis and the perpendicular slope, evaluates the line at any x, and draws the graph. If the two x-values match, the run is zero and the line is vertical (x = constant), with no slope-intercept form.

Worked example

For the points (1, 2) and (4, 8): the slope is m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. The intercept is b = 2 − 2 × 1 = 0, so the line is y = 2x. Its point-slope form is y − 2 = 2(x − 1) and its standard form is 2x − y = 0. With fractions: through (2, 3) and (7, −9), m = −12/5 and b = 3 − (−12/5)(2) = 39/5, so y = (−12/5)x + 39/5, which is 12x + 5y = 39 in standard form, with an x-intercept at 3.25.

Sources: Linear equation — Wikipedia

Frequently asked questions

What do m and b represent?

m is the slope — the change in y for each unit increase in x, so a slope of 2 rises twice as fast as it runs. b is the y-intercept, the y-value where the line crosses the vertical axis, at the point (0, b).

How do I find the equation from a point and a slope?

Substitute the point into y = mx + b and solve for b. With slope 1/2 through (5, 6): 6 = (1/2)(5) + b, so b = 7/2 and the line is y = (1/2)x + 7/2. Choose “Point & slope” to do this with your numbers.

How do I convert standard form to slope-intercept form?

Solve Ax + By = C for y: subtract Ax from both sides and divide by B, giving y = (−A/B)x + C/B. For 6x − 2y = 12 that is y = 3x − 6. Choose “Standard form” and enter A, B and C.

Why is a vertical line a problem?

A vertical line has the same x for every point, so the run x₂ − x₁ is zero and the slope would divide by zero. Such a line can’t be written as y = mx + b; instead it is written x = constant.

Why does the answer show fractions?

Slopes are often fractions such as 2/3 that never end as decimals. Keeping them exact means the equation goes through your points precisely. The “Equation with decimals” line and the decimal after ≈ give the rounded values if you need them.

How are parallel and perpendicular lines related?

Parallel lines share the same slope. Perpendicular lines have slopes that multiply to −1, so the perpendicular slope is −1 ÷ m: a line with slope 2 is perpendicular to any line with slope −1/2.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.