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.
How to Use the Linear Equation Calculator
- Choose an equation type using the tabs: one-variable, two-variable, slope-intercept, two-points, or custom.
- Enter the coefficients. Negative numbers, fractions (as decimals), and zero are allowed.
- Click Solve to get the exact solution, the decimal approximation, a graph (for two-variable cases), and step-by-step working.
- 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.
| Step | Calculation | Result |
|---|---|---|
| Subtract 4 from both sides | 2x = 10 − 4 | 2x = 6 |
| Divide by 2 | x = 6 / 2 | x = 3 |
| Check | 2·3 + 4 | 10 ✓ |
Solve 2x − 3y = 6 for y.
| Step | Calculation | Result |
|---|---|---|
| Isolate y-term | −3y = −2x + 6 | — |
| Divide by −3 | y = (2/3)x − 2 | y = (2/3)x − 2 |
Interpreting the Result
- Unique solution — one specific value (or one specific point) satisfies the equation.
- No solution — after simplification, a false statement remains (e.g., 0 = 5). For two lines: they are parallel.
- Infinitely many solutions — after simplification, a true statement remains (e.g., 0 = 0). For two lines: they are identical.
- Positive slope — line rises. Negative slope — line falls. Zero slope — horizontal. Undefined slope — vertical.
- y-intercept — where the line crosses x = 0; x-intercept — where it crosses y = 0.
Assumptions and Limits
- All coefficients must be finite real numbers; blank or non-numeric input is rejected.
- One-variable equations with a = 0 are special: they yield no solution or infinitely many — both handled explicitly.
- Two-variable equations with B = 0 produce a vertical line
x = C/A(not expressible as y = mx + b). - For two points, x₁ ≠ x₂ is required; otherwise the line is vertical.
- Exact answers are shown as reduced fractions; decimals are rounded to 6 significant figures.
- Floating-point comparisons use a 1e-12 tolerance to avoid false no-solution flags on near-zero coefficients.
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.