System of Equations Calculator
Solve 2 ร 2, 3 ร 3 and 4 ร 4 simultaneous equations by elimination, substitution or Cramer's rule
A system of equations calculator finds the values that make every equation true at the same time. For 2x + 3y = 7 and x โ 2y = โ7 the solution is x = โ1, y = 3: elimination removes x and leaves โ7y = โ21, and back substitution gives x. Type your own 2 ร 2, 3 ร 3 or 4 ร 4 system below to see elimination, substitution and Cramer's rule step by step.
Last updated October 2026
Method: Gaussian elimination with whole-number row operations and back substitution, the substitution method for 2 × 2 systems, and Cramer's rule with cofactor expansion for 2 × 2 and 3 × 3 systems. All arithmetic uses exact fractions. The number of solutions is decided by comparing the rank of the coefficient matrix with the rank of the augmented matrix.
Included: Typed equations or a coefficient grid, two to four unknowns, decimal and fraction coefficients, every elimination step, substitution steps, the determinants D, Dx, Dy and Dz, detection of no solution and infinitely many solutions, the parametric and vector form of a solution set, and a check against the original equations.
Not included: Nonlinear terms such as xยฒ, xy or 1/x, systems with more equations than unknowns or the reverse, more than four unknowns, graphs, and complex coefficients.
๐ Enter your system
Use x and y. Write coefficients before the variable (2x, -y, 0.5z, 3/4w); terms may sit on both sides of the equals sign, and parentheses such as 2(x + y) are fine.
๐ One unique solution
๐ Step-by-step solution
Start: number the equations
| (1) | 2x | + 3y | = | 7 |
| (2) | x | โ 2y | = | โ7 |
Step 1: Eliminate x from equation (2)
Multiply equation (2) by 2 and subtract equation (1), then divide the result by โ7. This removes x from equation (2).
(2) โ 2ยท(2) โ (1)
| 2ยท(2) | 2x | โ 4y | = | โ14 |
| โ (1) | 2x | + 3y | = | 7 |
| = | โ7y | = | โ21 | |
| รท (โ7) | y | = | 3 |
The system now reads:
| (1) | 2x | + 3y | = | 7 |
| (2) | y | = | 3 |
Back substitution
Solve equation (2) for y:
y = 3
Solve equation (1) for x:
2x + 3y = 7
2x + 3(3) = 7
2x = โ2
x = โ1
โ๏ธ Check the answer
Substitute the solution into each original equation; both sides must agree.
(1) 2(โ1) + 3(3) = โ2 + 9 = 7 โ
(2) (โ1) โ 2(3) = โ1 โ 6 = โ7 โ
System of equations calculator: elimination, substitution and Cramer's rule explained
A system of linear equations is a set of equations that share the same unknowns, and solving it means finding values that satisfy all of them at once. Simultaneous equations is the same idea under its British name. This calculator handles two, three or four unknowns, keeps every number as an exact fraction, and writes out the full working for elimination, for substitution (2 × 2) and for Cramer's rule (2 × 2 and 3 × 3).
If you only have one equation in one unknown, the Linear Equation Calculator or the Algebra Calculator is faster. To row-reduce a matrix on its own, use the RREF Calculator, and for determinants and inverses, the Matrix Calculator.
What a system of equations is, and the three possible answers
Each linear equation in two unknowns is a straight line, and the solution of a 2 × 2 system is the point where the two lines meet. That picture explains why there are only three possible outcomes. Two lines with different slopes cross exactly once, so the system has one solution. Two parallel lines never meet, so there is no solution. Two equations that describe the same line share every point, so there are infinitely many solutions.
The same three outcomes hold at any size. With three unknowns each equation is a plane in space: three planes usually meet at a single point, but they can also share a whole line or have no point in common. Algebraically, the deciding number is the determinant D of the coefficient matrix. When D is not zero the solution is unique. When D is 0, elimination ends with a row that has no variables left, and that row decides: 0 = 0 means infinitely many solutions, while 0 = 5, or any other nonzero constant, means none.
The formulas behind each method
For a 2 × 2 system the whole method fits in a few lines. The rank conditions at the bottom apply to every size, with n unknowns:
aโx + bโy = cโ aโx + bโy = cโ D = aโbโ โ aโbโ Dx = cโbโ โ cโbโ Dy = aโcโ โ aโcโ x = Dx / D y = Dy / D (only when D โ 0) rank A = rank [A | b] = n โ exactly one solution rank A = rank [A | b] < n โ infinitely many solutions rank A < rank [A | b] โ no solution In Dx the constants replace the x column of the coefficient matrix, and in Dy they replace the y column. A 3 × 3 system follows the same rule with three-by-three determinants, which the calculator expands by cofactors along the first row: a(ei โ fh) โ b(di โ fg) + c(dh โ eg). The rank is the number of pivots elimination finds, and [A | b] is the augmented matrix, the coefficients with the constants attached as an extra column.
Worked example 1: one 2 ร 2 system, three methods
Take 2x + 3y = 7 and x โ 2y = โ7, the default system in the calculator.
Elimination. Multiply the second equation by 2 so both equations start with 2x, then subtract the first:
2 ยท (x โ 2y = โ7): 2x โ 4y = โ14 subtract 2x + 3y = 7: โ7y = โ21 divide by โ7: y = 3 Back substitution into 2x + 3y = 7 gives 2x + 9 = 7, so 2x = โ2 and x = โ1.
Substitution. The second equation has a lone x, so solve it for x: x = 2y โ 7. Put that into the first equation: 2(2y โ 7) + 3y = 7 expands to 4y โ 14 + 3y = 7, then 7y = 21 and y = 3. Back-substitute: x = 2(3) โ 7 = โ1.
Cramer's rule. D = (2)(โ2) โ (3)(1) = โ7, Dx = (7)(โ2) โ (3)(โ7) = โ14 + 21 = 7 and Dy = (2)(โ7) โ (7)(1) = โ21, so x = 7 / (โ7) = โ1 and y = โ21 / (โ7) = 3. All three methods agree, and the check 2(โ1) + 3(3) = 7 and (โ1) โ 2(3) = โ7 confirms that the two lines cross at (โ1, 3).
Worked example 2: fraction answers with Cramer's rule
Plenty of systems do not come out in whole numbers. For 3x + 4y = 10 and 5x โ 2y = 3:
D = (3)(โ2) โ (4)(5) = โ6 โ 20 = โ26 Dx = (10)(โ2) โ (4)(3) = โ20 โ 12 = โ32 Dy = (3)(3) โ (10)(5) = 9 โ 50 = โ41 x = โ32 / โ26 = 16/13 โ 1.2308 y = โ41 / โ26 = 41/26 โ 1.5769 The exact fractions matter. Round x to 1.23 and substitute it into the first equation, and you get y = 1.5775 instead of 1.5769; the second equation then gives 5(1.23) โ 2(1.5775) = 2.995 instead of 3. The calculator keeps 16/13 and 41/26 exact through every step and checks them against both original equations: 3(16/13) + 4(41/26) = 48/13 + 82/13 = 10.
Worked example 3: a 3 ร 3 system by elimination
Load the 3 × 3 preset: 2x + y โ z = 3, x โ y + 2z = 5 and 3x + 2y + z = 10. Elimination works one column at a time, with whole-number multipliers so no fractions appear along the way:
(2) โ 2ยท(2) โ (1): โ3y + 5z = 7, times โ1: 3y โ 5z = โ7 (3) โ 2ยท(3) โ 3ยท(1): y + 5z = 11 (3) โ 3ยท(3) โ (2): 20z = 40, so z = 2 The system is now triangular: 2x + y โ z = 3, 3y โ 5z = โ7 and z = 2. Back substitution climbs back up. From the second equation, 3y โ 5(2) = โ7 gives 3y = 3 and y = 1. From the first, 2x + 1 โ 2 = 3 gives 2x = 4 and x = 2. Cramer's rule agrees: D = โ10, Dx = โ20, Dy = โ10 and Dz = โ20, so x = 2, y = 1 and z = 2.
No solution and infinitely many solutions
Change one number and the picture changes completely. The system x + 2y = 4 and 2x + 4y = 5 describes two parallel lines: subtracting twice the first equation from the second leaves 0 = โ3, a false statement, so there is no solution. With 2x + 4y = 8 instead, the same step leaves 0 = 0, which is always true. The second equation was simply the first one doubled, so every point on the line x + 2y = 4 is a solution.
The calculator writes that infinite set in parametric form. Let the free variable be y = t; then x = 4 โ 2t, and each real value of t gives one solution, such as (4, 0) for t = 0 or (2, 1) for t = 1. The same idea works with three unknowns. In x + y + z = 6, 2x + 3y + z = 14 and 3x + 4y + 2z = 20, the third equation is the sum of the first two, so elimination ends with 0 = 0 and the answer is x = 4 โ 2t, y = 2 + t, z = t, or in vector form (x, y, z) = (4, 2, 0) + t(โ2, 1, 1). Change the 20 to 21 and the last row becomes 0 = 1: no solution.
Word problems: where systems of equations come from
Most systems start as a story. A school play sells 240 tickets at $8 for adults and $5 for students and takes in $1,620. With x adult tickets and y student tickets, x + y = 240 and 8x + 5y = 1620. Solving gives x = 140 and y = 100, and the check is quick: 140 × $8 = $1,120 and 100 × $5 = $500, which add up to $1,620.
A three-unknown version: $20,000 is split across accounts paying 2%, 4% and 5% a year, the yearly interest is $680, and twice as much sits in the 2% account as in the 5% account. That gives x + y + z = 20000, 0.02x + 0.04y + 0.05z = 680 and x โ 2z = 0. The calculator first multiplies the decimal equation by 100 to get whole numbers, 2x + 4y + 5z = 68000, and then solves: $8,000 at 2%, $8,000 at 4% and $4,000 at 5%.
Beyond homework, the same structure balances chemical equations, mixes solutions to a target concentration, finds the break-even point where a cost line and a revenue line cross, and solves electrical circuits, one equation per loop or junction. Students in Algebra 1, Algebra 2, precalculus and linear algebra use the step-by-step output to check homework, and teachers use the presets to show how one changed number turns a unique solution into none.
Eleven example systems and what the calculator returns
Every row is one of the calculator's presets, computed with the same exact-fraction code. The determinant and the two ranks tell the whole story: a nonzero D means one solution, and when D = 0 the ranks decide between none and infinitely many.
| System | D | rank A / [A | b] | Result |
|---|---|---|---|
| 2x + 3y = 7; x โ 2y = โ7 | โ7 | 2 / 2 | x = โ1, y = 3 |
| 3x + 4y = 10; 5x โ 2y = 3 | โ26 | 2 / 2 | x = 16/13, y = 41/26 |
| x + y = 240; 8x + 5y = 1620 | โ3 | 2 / 2 | x = 140, y = 100 |
| x + 2y = 4; 2x + 4y = 5 | 0 | 1 / 2 | No solution |
| x + 2y = 4; 2x + 4y = 8 | 0 | 1 / 1 | x = 4 โ 2t, y = t |
| 2x + y โ z = 3; x โ y + 2z = 5; 3x + 2y + z = 10 | โ10 | 3 / 3 | x = 2, y = 1, z = 2 |
| x + y + z = 20000; 0.02x + 0.04y + 0.05z = 680; x โ 2z = 0 | โ3/100 | 3 / 3 | x = 8000, y = 8000, z = 4000 |
| x + y + z = 6; 2x + 3y + z = 14; 3x + 4y + 2z = 20 | 0 | 2 / 2 | x = 4 โ 2t, y = 2 + t, z = t |
| x + y + z = 6; 2x + 3y + z = 14; 3x + 4y + 2z = 21 | 0 | 2 / 3 | No solution |
| x + y + z + w = 5; 2x โ y + z โ w = โ4; x + 2y โ z + 2w = 12; 3x + y + 2z โ w = 0 | โ14 | 4 / 4 | x = 1, y = 2, z = โ1, w = 3 |
| x + y + z + w = 4; 2x + 2y + 2z + 2w = 8; x โ y + z โ w = 0; 3x + y + 3z + w = 8 | 0 | 2 / 2 | x = 2 โ t, y = 2 โ s, z = t, w = s |
The decimal row shows that D can be a fraction: the coefficients 0.02, 0.04 and 0.05 make D = โ3/100, which is still not zero, so the solution is unique. The last row has two free variables, so its solution set is a whole plane of points described by two parameters, t and s.
How much work each method takes
Cramer's rule is elegant for two or three unknowns, but its cost explodes. The table counts the multiplications and divisions (additions ignored) needed to solve an n × n system: Gaussian elimination with back substitution against Cramer's rule with every determinant expanded by cofactors along the first row. The counts come from running both algorithms and tallying each operation.
| Unknowns (n) | Elimination | Cramer's rule | Cramer รท elimination |
|---|---|---|---|
| 2 | 6 | 8 | 1.3 |
| 3 | 17 | 39 | 2.3 |
| 4 | 36 | 204 | 5.7 |
| 5 | 65 | 1,235 | 19.0 |
| 6 | 106 | 8,658 | 81.7 |
| 8 | 232 | 623,528 | 2,687.6 |
| 10 | 430 | 68,588,310 | 159,507.7 |
At four unknowns Cramer's rule already needs more than five times the work, and at ten unknowns about 160,000 times as much. That is why this calculator offers Cramer's rule only for 2 × 2 and 3 × 3 systems and relies on elimination everywhere else. Numerical software uses elimination too, normally with partial pivoting (swapping rows so the largest available coefficient becomes the pivot) to keep rounding errors small.
How to use this calculator
Pick the size first: 2 × 2 uses x and y, 3 × 3 adds z, and 4 × 4 adds w. Then type each equation the way you would write it. Entries such as 2x + 3y = 7, -x + 0.5y = 3/4 or 3(x - y) = 2z + 1 all work, and terms may sit on either side of the equals sign. If you prefer numbers only, switch to the coefficient grid, where each row holds the coefficients and the constant; switching between the two keeps your system.
The blue card gives the answer: each variable's value for a unique solution, the parametric form for infinitely many, or a no-solution message, together with the determinant and both ranks. Below it, tabs show elimination, substitution (2 × 2) and Cramer's rule (2 × 2 and 3 × 3), and the check card substitutes the answer into your original equations. The Try buttons load the word problems and special cases from this page.
Key terms
- Linear equation: every variable appears to the first power only, with no products of variables.
- System of equations (simultaneous equations): two or more equations with shared unknowns that must hold at the same time.
- Coefficient matrix A, augmented matrix [A | b]: the numbers in front of the variables, without or with the constants attached.
- Elimination (Gaussian elimination): adding multiples of equations to remove one variable at a time.
- Back substitution: solving the last equation first and working upward.
- Substitution: solving one equation for a variable and inserting the result into the others.
- Determinant D: a number computed from the coefficients; D โ 0 means exactly one solution.
- Cramer's rule: x = Dx / D, y = Dy / D, z = Dz / D, valid only when D โ 0.
- Consistent, inconsistent: a system with at least one solution, or with none.
- Dependent: a consistent system with infinitely many solutions, because one equation adds nothing new.
- Free variable, parameter: a variable that can take any value, written as t (and s), with the other variables expressed in terms of it.
- Rank: the number of pivots, or independent equations, that elimination finds.
Tips, pitfalls and limits
- Line up the variables. Write every equation with x, y and z in the same order before eliminating. The calculator does this automatically when it reads your typed equations.
- Scale both sides. When you multiply an equation, multiply the constant on the right as well.
- Small changes can matter a lot. x + y = 2 and x + 1.001y = 2.001 have the exact solution x = 1, y = 1, but round 1.001 to 1 and the lines become parallel, with no solution at all. Nearly parallel systems are called ill-conditioned, and they are exactly where exact fractions earn their keep.
- D = 0 is not the same as no solution. It means not exactly one solution; elimination decides between none and infinitely many.
- Parametric answers can look different and still agree. x = 4 โ 2t, y = t and x = s, y = 2 โ s/2 describe the same line.
The calculator solves square linear systems with two, three or four unknowns. It rejects nonlinear terms such as xยฒ, xy or 1/x with a short explanation, and it does not handle systems with more equations than unknowns (or fewer), complex coefficients or variable names other than x, y, z and w. Fractions can grow long when the inputs have many decimal places, but the answer is never rounded.
Related calculators
- To reduce the augmented matrix all the way to reduced row echelon form, use the RREF Calculator.
- For determinants, inverses and matrix products, use the Matrix Calculator.
- To solve a single equation for x with steps, use the Algebra Calculator or the Linear Equation Calculator.
- For dot products, cross products and the 3 × 3 determinant of three vectors, use the Vector Calculator.
- To find the slope of each line in a 2 × 2 system, use the Slope Calculator.
- To simplify the fractions in an answer by hand, use the Fraction Calculator.
Sources
Solving linear systems is deterministic mathematics, so every figure on this page follows from the methods themselves. The methods match these references:
- NIST Digital Library of Mathematical Functions, ยง3.2 Linear Algebra: Gaussian elimination on the augmented matrix, forward elimination followed by back substitution, and partial pivoting.
- NIST Digital Library of Mathematical Functions, ยง1.3 Determinants: cofactors (1.3.3) and the expansion of a determinant along a row (1.3.4), used for D, Dx, Dy and Dz.
- MIT OpenCourseWare 18.06SC Linear Algebra (Gilbert Strang), Elimination with Matrices.
- MIT OpenCourseWare 18.06SC, Cramer's Rule, Inverse Matrix and Volume.
- MIT OpenCourseWare 18.06SC, Solving Ax = b: Row Reduced Form R: the complete solution as a particular solution plus the nullspace, and the rank conditions for one, none or infinitely many solutions.
- All worked examples, table entries and operation counts were computed with the calculator's own exact-fraction code and instrumented test scripts.
โ ๏ธ Common mistakes & edge cases
Scaling only the left side
Doubling x โ 2y = โ7 gives 2x โ 4y = โ14, not 2x โ 4y = โ7. Leaving the constant alone silently changes the equation, and every later step inherits the error.
Losing a sign when subtracting
Subtracting 2x + 3y = 7 from 2x โ 4y = โ14 gives โ7y = โ21, so y = 3. Drop one negative and you get y = โ3, which then fails the check in both equations. Subtract every term, including the constant, inside parentheses.
Stopping after the first variable
Finding y = 3 is only half the job. Substitute it back to get x = โ1 and report the solution as the pair (โ1, 3), or as a triple for three unknowns.
Reading D = 0 as no solution
x + 2y = 4 with 2x + 4y = 5 and x + 2y = 4 with 2x + 4y = 8 both have D = 0. The first has no solution and the second has infinitely many. Only elimination, or the ranks, can tell them apart.
Rounding in the middle of the work
Rounding 16/13 to 1.23 in worked example 2 produced y = 1.5775 instead of 41/26 โ 1.5769, and a second equation that missed by 0.005. Keep fractions until the final line.
Mixing up the variable order
If one equation is written y + 2x = 5 and the other 3x โ y = 4, rewrite the first as 2x + y = 5 before you add them. Adding the equations as written lines up unlike terms and gives nonsense.
❓ Frequently asked questions
How do I solve a system of equations?
Use elimination, substitution or Cramer's rule to reduce the system to one equation in one unknown, solve that, then substitute back to find the others. For 2x + 3y = 7 and x โ 2y = โ7, doubling the second equation and subtracting the first leaves โ7y = โ21, so y = 3, and then 2x + 9 = 7 gives x = โ1. Finish by checking the pair in both original equations.
How does the elimination method work?
Elimination adds or subtracts multiples of the equations so that one variable cancels. Scale one or both equations until a variable has matching coefficients, subtract, and solve what is left. In a 3 ร 3 system, use the first equation to remove x from the other two, use the new second equation to remove y from the third, and finish with back substitution. The calculator shows every multiplier and the lined-up subtraction.
How does the substitution method work?
Solve one equation for one variable, replace that variable in the other equation, and solve the single equation that results. With x + y = 240 and 8x + 5y = 1620, the first equation gives x = 240 โ y, so 8(240 โ y) + 5y = 1620, which simplifies to 1920 โ 3y = 1620 and y = 100. Then x = 240 โ 100 = 140. Substitution is easiest when a variable already has a coefficient of 1.
What is Cramer's rule, and when can I use it?
Cramer's rule solves a square system with determinants: x = Dx / D, y = Dy / D and, with three unknowns, z = Dz / D. D comes from the coefficients, and Dx is the same determinant with the x column replaced by the constants. For 2x + 3y = 7 and x โ 2y = โ7, D = โ7, Dx = 7 and Dy = โ21, so x = โ1 and y = 3. It only works when D is not zero.
How can I tell if a system has no solution or infinitely many solutions?
Run elimination until no more variables can be removed. If a row ends up as 0 = c with c not zero, such as 0 = โ3, the equations contradict each other and there is no solution. If the leftover rows read 0 = 0, at least one equation repeated information and there are infinitely many solutions. In both cases the determinant is 0, while a nonzero determinant always means exactly one solution.
What does a parametric solution like x = 4 โ 2t mean?
It describes infinitely many solutions at once. The free variable gets a parameter, here y = t, and every other variable is written in terms of it. Each real number t produces one valid solution: t = 0 gives (4, 0), t = 1 gives (2, 1) and t = โ3 gives (10, โ3). All of these points lie on the line x + 2y = 4, the solution set of the dependent system x + 2y = 4 and 2x + 4y = 8.
Can this calculator solve three equations with three unknowns, or four?
Yes. Choose 3 ร 3 for x, y and z, or 4 ร 4 for x, y, z and w. The system 2x + y โ z = 3, x โ y + 2z = 5, 3x + 2y + z = 10 has the solution x = 2, y = 1, z = 2, and the 4 ร 4 preset returns x = 1, y = 2, z = โ1, w = 3. Elimination steps are shown for every size, Cramer's rule for 2 ร 2 and 3 ร 3, and substitution for 2 ร 2.
Are simultaneous equations the same as a system of equations?
Yes. Simultaneous equations is the usual name in British schools, and system of equations is the common American term. Both mean a set of equations with shared unknowns that must all be true at the same time, and the methods are identical: elimination, substitution, Cramer's rule or graphing. A simultaneous equations solver and a system of equations calculator do the same job.
Can I enter equations with fractions, decimals or variables on both sides?
Yes. You can type 0.5x + 1/4y = 3, x/2 โ y = 1 or 3(x โ y) = 2y + 1. The calculator moves every variable to the left and every constant to the right before solving, so 3(x โ y) = 2y + 1 is read as 3x โ 5y = 1. Decimals become exact fractions, and the elimination steps begin by multiplying such equations by a whole number to clear them.
Which method should I use: elimination, substitution or Cramer's rule?
Use substitution for 2 ร 2 systems in which a variable already has a coefficient of 1 or โ1, such as x โ 2y = โ7. Use elimination for everything else, especially three or more unknowns, because it scales well and exposes no-solution and infinite-solution cases. Cramer's rule suits 2 ร 2 and 3 ร 3 systems when you want a formula, but a 4 ร 4 system already takes 204 multiplications and divisions against 36 for elimination.
๐ก Good to know
The determinant ignores the right-hand side
D depends only on the coefficients. For 2x + 3y = 7 and x โ 2y = โ7, D = โ7, so replacing 7 and โ7 with any other numbers still gives exactly one solution. Whether a system is uniquely solvable is a property of its left-hand sides.
Whole-number elimination avoids fractions until the end
Instead of dividing by a pivot, the calculator multiplies rows by whole numbers, as in 3ยท(3) โ (2) for the 3 × 3 example, and divides out common factors. Integer inputs therefore stay integers through every elimination step; fractions appear only in back substitution, if the answer needs them.
A check takes seconds and catches almost everything
Substituting the answer into every original equation is the fastest way to catch arithmetic slips. The calculator does it for you: for the ticket problem, 140 + 100 = 240 and 8(140) + 5(100) = 1,120 + 500 = 1,620.