Linear Equation Solver

Quick answer

To solve a linear equation, move the x terms to one side and the plain numbers to the other. Then divide both sides by the number in front of x. For 2x + 3 = 11, subtract 3 to get 2x = 8, so x = 4. A system of two equations is solved the same way after you cancel one variable.

Updated 2026-09-26By Shakeel MuzaffarReviewed by Prof. Dr. Khalil Mudassar, PhD
Try
Linear Equations
Type the numbers in front of each variable. Use a minus sign for negatives and 0 for a missing term.
x
Number in front of x on the left side.
Plain number on the left side.
x
Number in front of x on the right side. Use 0 if there is none.
Plain number on the right side.
Solution for x
--
Equation--
Exact value--
Decimal value--
Step 1: collect x terms--
Step 2: divide--
Check--

Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.

Saved results (0)

How to Use the Solver

  1. Pick one variable for an equation like 5x - 7 = 2x + 8, or pick system of two equations for a pair of equations in x and y.
  2. Type the number in front of each variable and each plain number. Use a minus sign for negatives, and type 0 for any term that is missing.
  3. Read the answer at the top. The cards below show the steps, or the determinant for a system, plus a check that puts the answer back into the equation.
  4. Press Copy report or Save to keep the result.

For example, 5x - 7 = 2x + 8 is entered as a = 5, b = -7, c = 2, and d = 8.

What Is a Linear Equation?

A linear equation is an equation where every variable has a power of 1. You will not see x squared, a square root of x, or x under a fraction bar. The graph of a linear equation in two variables is a straight line.

Standard form in one variable: ax + b = 0, where a is not 0

The equations 2x + 3 = 11 and 4x - y = 10 are linear. The equations x^2 = 9 and 1/x = 4 are not, because x has a power other than 1.

A linear equation in one variable has exactly one answer, no answer, or every number as an answer. There are no other options, which makes these equations easy to check.

Solving One-Variable Equations Step by Step

The goal is to get x alone on one side. Whatever you do to one side, you must also do to the other side. That keeps the equation balanced.

General rule: ax + b = cx + d, so (a - c)x = d - b, so x = (d - b) / (a - c)

Worked Example: 5x - 7 = 2x + 8

  1. Collect the x terms. Subtract 2x from both sides: 3x - 7 = 8.
  2. Isolate the x term. Add 7 to both sides: 3x = 15.
  3. Divide both sides by 3: x = 5.
  4. Check. The left side is 5(5) - 7 = 18. The right side is 2(5) + 8 = 18. Both sides match.

When the Answer Is a Fraction

Take 3x + 2 = 7. Subtract 2 to get 3x = 5. Then divide by 3 to get x = 5/3. As a decimal, that is about 1.666667. The fraction is the exact answer, so keep it when you check your work.

Systems: Substitution vs Elimination

A system is two equations that share the same two variables. The solution is the point where their lines cross.

a1 x + b1 y = c1 and a2 x + b2 y = c2

Substitution

Solve one equation for one variable, then plug it into the other. For x + y = 10 and x - y = 2, the first gives y = 10 - x. Then x - (10 - x) = 2, so 2x - 10 = 2 and x = 6. That makes y = 10 - 6 = 4.

Elimination

Add or subtract the equations so one variable cancels. Adding x + y = 10 and x - y = 2 gives 2x = 12, so x = 6 again. Elimination is often faster when the coefficients already line up.

Cramer's Rule

This calculator uses Cramer's rule, a shortcut based on determinants. It gives the same answer as the other two methods.

D = a1 b2 - a2 b1, x = (c1 b2 - c2 b1) / D, y = (a1 c2 - a2 c1) / D

For 2x + 3y = 12 and 4x - y = 10: D = 2(-1) - 4(3) = -14. Dx = 12(-1) - 10(3) = -42, and Dy = 2(10) - 4(12) = -28. So x = -42 / -14 = 3 and y = -28 / -14 = 2.

Want to see the lines themselves? Our slope calculator finds the slope of each one.

Special Cases: No Solution and Infinitely Many

Sometimes the x terms cancel completely. What is left tells you which case you have.

What is leftMeaningExample
A false statement, like 1 = 4No solution3x + 1 = 3x + 4
A true statement, like 6 = 6Infinitely many solutions (an identity)2x + 6 = 2x + 6

Systems work the same way. When the determinant D is 0, the two lines have the same slope. If one equation is just a multiple of the other, they are the same line and there are infinitely many solutions. If only the left sides match, the lines are parallel and never meet.

Example: 2x + 4y = 8 and x + 2y = 5. Doubling the second gives 2x + 4y = 10. The left sides match but 8 is not 10, so there is no solution.

Common Mistakes

1. Sign Errors When Moving Terms

When a term moves to the other side, its sign flips. From 5x - 7 = 8, adding 7 gives 5x = 15. Writing 5x = 1 means the 7 was subtracted instead of added.

2. Not Distributing a Negative

A minus sign in front of brackets changes every term inside. So -(x - 4) is -x + 4, not -x - 4. Missing the second sign is one of the most common algebra slips.

3. Dividing Only One Side, or Only One Term

From 3x = 12 + 6, you must divide the whole right side by 3. The answer is x = 18 / 3 = 6. Dividing only the 12 gives 4 + 6 = 10, which is wrong.

4. Skipping the Check

Put your answer back into the original equation. If both sides do not match, there is an error somewhere. The calculator does this check for you.

How We Calculate

One variable
The equation a x + b = c x + d is rearranged to (a - c) x = d - b, then divided by a - c.
System
Cramer's rule: D = a1 b2 - a2 b1, x = Dx / D, and y = Dy / D.
Exact fractions
Whole numbers and decimals with up to 6 places are turned into exact fractions and reduced by their greatest common divisor. Other inputs are solved in decimals only.
Special cases
If a = c, the result is an identity when b = d and has no solution otherwise. If D = 0, the equations are checked for proportionality to tell the same line from parallel lines.
Check
The answer is put back into each original equation, and both sides are compared.
Rounding
Decimals show up to 6 places. Fractions are exact.
Last reviewed
2026-09-26.

Frequently Asked Questions

What is a linear equation?

A linear equation is an equation where each variable appears only to the first power. There are no squares, roots, or variables in a denominator. Its graph is a straight line, which is where the name comes from.

How do you solve a linear equation with x on both sides?

Move every x term to one side and every plain number to the other side. Then divide both sides by the number in front of x. For 5x - 7 = 2x + 8, subtract 2x and add 7 to get 3x = 15, so x = 5.

What does it mean when an equation has no solution?

It means no value of x can make both sides equal. The x terms cancel out and leave a false statement, such as 1 = 4. The equation 3x + 1 = 3x + 4 is an example.

What does infinitely many solutions mean?

It means every value of x works. The two sides are the same expression, so the x terms cancel and leave a true statement such as 6 = 6. This kind of equation is called an identity.

What is Cramer's rule?

Cramer's rule solves a system with determinants. For two equations, D = a1 b2 - a2 b1, and then x = Dx / D and y = Dy / D. It only works when D is not zero.

Should I use substitution or elimination for a system?

Use substitution when one variable already has a coefficient of 1 or -1, because it is easy to isolate. Use elimination when the coefficients line up so that adding or subtracting the equations cancels a variable. Both give the same answer.

Why does the answer show as a fraction?

Many linear equations have answers that are not whole numbers. A fraction such as 5/3 is exact, while the decimal 1.666667 is rounded. The calculator shows both so you can use whichever your class or task needs.

Sources

Related Guides

Related Calculators

Looking for more math tools?

Explore all math calculators

This solver handles linear equations in one variable and systems of two linear equations in two variables. Decimal results are rounded for display; fractions are exact. Spotted an error? Let us know.

Author

shakeel-Muzaffar
Founder & Editor-in-Chief at  ~ Web ~  More Posts

Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.