Skip to main content
MathStatCalc

Linear Equation Calculator

Use this free linear equation calculator to solve one-variable equations (ax + b = c), two-variable equations (Ax + By = C), or slope-intercept form (y = mx + b). Get the exact fraction, the decimal, an interactive graph, and a full step-by-step substitution — with automatic detection of no solution and infinitely many solutions.

Form: ax + b = c

How to Use the Linear Equation Calculator

  1. Choose an equation type using the tabs: one-variable, two-variable, slope-intercept, two-points, or custom.
  2. Enter the coefficients. Negative numbers, fractions (as decimals), and zero are allowed.
  3. Click Solve to get the exact solution, the decimal approximation, a graph (for two-variable cases), and step-by-step working.
  4. The calculator flags “no solution” (parallel lines) and “infinitely many solutions” (identical lines) automatically.

Formula & Calculation Method

A linear equation is an algebraic equation in which every term is either a constant or a product of a constant and a single variable raised to the first power. Its graph is a straight line.

One-variable: ax + b = c

Isolate x: x = (c − b) / a, valid when a ≠ 0. If a = 0 and b = c → infinitely many solutions; if a = 0 and b ≠ c → no solution.

Two-variable: Ax + By = C

Solve for y to obtain slope-intercept form: y = (−A/B)x + C/B, valid when B ≠ 0. If B = 0 the line is vertical: x = C/A.

Custom: a₁x + b₁ = a₂x + b₂

Collect variables on one side: (a₁ − a₂)x = b₂ − b₁, so x = (b₂ − b₁) / (a₁ − a₂), valid when a₁ ≠ a₂.

Worked Example

Solve 2x + 4 = 10.

StepCalculationResult
Subtract 4 from both sides2x = 10 − 42x = 6
Divide by 2x = 6 / 2x = 3
Check2·3 + 410 ✓

Solve 2x − 3y = 6 for y.

StepCalculationResult
Isolate y-term−3y = −2x + 6—
Divide by −3y = (2/3)x − 2y = (2/3)x − 2

Interpreting the Result

Assumptions and Limits

Frequently Asked Questions

What is a linear equation?

A linear equation is an equation in which every term is either a constant or a constant times a single variable to the first power. Its graph is a straight line. Standard forms include ax + b = c and Ax + By = C.

How do I solve ax + b = c?

Subtract b from both sides: ax = c − b. Then divide by a (assuming a ≠ 0): x = (c − b) / a. If a = 0, the equation either has no solution (b ≠ c) or infinitely many (b = c).

What does “no solution” mean?

It means no value of the variable satisfies the equation. This occurs when simplification yields a false statement like 0 = 5, or geometrically when two lines are parallel and never intersect.

What does “infinitely many solutions” mean?

It means every value satisfies the equation. This occurs when simplification yields a true statement like 0 = 0, or geometrically when two lines are identical and overlap completely.

How do I convert Ax + By = C to slope-intercept form?

Solve for y: y = (−A/B)x + C/B. The slope is m = −A/B and the y-intercept is b = C/B, valid when B ≠ 0.

Can I solve a linear equation with fractions?

Yes. Enter fractions as decimals (e.g., 0.5 for 1/2, or 0.333333 for 1/3). For exact results, use terminating decimals or expressions already in decimal form — the calculator shows reduced fractions when possible.

How does the calculator handle vertical lines?

If B = 0 in Ax + By = C, the line is vertical and cannot be written as y = mx + b. The calculator returns x = C/A and flags that the slope is undefined.

Does this calculator work for systems of equations?

This tool solves a single linear equation. For a system of two or more linear equations (e.g., 2x + y = 5 and x − y = 1), use a dedicated system-of-equations calculator, or enter the two equations one at a time to explore their lines and see where they intersect.

Related Tools