System of linear equations solver
Type one equation per line, such as 2x + 3y = 7 and x − y = 1, and get the solution. The calculation uses exact fractions, so 1/3 stays 1/3 instead of 0.333….
One equation or a system, with unknowns such as x, y and z. Fractions such as 1/2 are allowed.
Fill in the fields; the answer appears here straight away.
How it's worked out
How it works
-
Enter the values
Type the numbers or the formula. Decimals may use a point or a comma. No idea? Click Fill in an example.
-
Instant answer
The answer appears as you type, with the most important intermediate values.
-
See the working
Under "How it's worked out" you see the steps, handy for checking your own calculation.
How to enter equations
- One equation per line, each with exactly one
=. - Use any letters as unknowns: x, y, z, or a, b, c.
- Multiplication signs are optional:
3xis 3 × x. Terms may be on both sides, such as2x + 1 = y − 3.
Three possible outcomes
- One solution: for 2x + 3y = 7 and x − y = 1 you get x = 2 and y = 1.
- No solution: the equations contradict each other, like x + y = 1 and x + y = 5.
- Infinitely many solutions: an equation is a combination of the others; you see which unknowns you can choose freely.
The method is Gauss-Jordan elimination, the same row reduction you would do on paper. Equations with x² or sin(x) are not linear; for one quadratic equation, use the quadratic equation solver.
A system with three unknowns
Solve x + y + z = 6, 2y + 5z = −4 and 2x + 5y − z = 27. Enter the three lines one under the other and you get x = 5, y = 3 and z = −2. Check by substituting: 5 + 3 − 2 = 6, 6 − 10 = −4 and 10 + 15 + 2 = 27.
A word problem
Two coffees and a piece of cake cost 7.50. One coffee and two pieces of cake cost 8.25. With c for coffee and k for cake, enter 2c + k = 7.5 and c + 2k = 8.25. The answer is c = 2.25 and k = 3. Letters of your own choice work as unknowns, which makes word problems easier to read.
Matrices behind the scenes
A system of n equations in n unknowns has a matrix of coefficients. If its determinant is not zero, there is exactly one solution, and the inverse of the matrix gives it. See the determinant calculator and the inverse matrix calculator.
Frequently asked questions
How many unknowns and equations can I enter?
As many as you like, as long as every equation is linear. Use any letters as unknowns, one equation per line or separated by semicolons.
What happens when the equations are not linear?
The calculator names the line and the offending term, such as x·y or x². For a single quadratic equation, use the [quadratic equation solver](/en/math/quadratic-equation-solver).
What if I have more equations than unknowns?
That is fine when they agree with each other. If they contradict, the calculator reports that there is no solution.
Why exact fractions?
Because x = 1/3 is the exact answer, while 0.3333 is only an approximation. Fractions avoid rounding errors in later steps.