๐Ÿ‡บ๐Ÿ‡ธ USC
Math & Conversion
๐Ÿ”—

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

Number of equations and unknowns
Input style

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.

Try:

๐Ÿ”— One unique solution

x
โˆ’1
y
3
The two lines cross at exactly one point.
Determinant D
โˆ’7
Rank of A / of [A | b]
2 / 2
System type
Consistent, independent

๐Ÿ“‹ Step-by-step solution

Start: number the equations

(1)2x+ 3y=7
(2)xโˆ’ 2y=โˆ’7
Augmented matrix [A | b]:
2371โˆ’2โˆ’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 โœ“

Everything is computed in your browser with exact fractions. A system has one solution when the determinant D is not 0; when D = 0, elimination decides between no solution (a row becomes 0 = c with c โ‰  0) and infinitely many solutions (free variables written with parameters t, s, โ€ฆ).

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โˆ’72 / 2x = โˆ’1, y = 3
3x + 4y = 10; 5x โˆ’ 2y = 3โˆ’262 / 2x = 16/13, y = 41/26
x + y = 240; 8x + 5y = 1620โˆ’32 / 2x = 140, y = 100
x + 2y = 4; 2x + 4y = 501 / 2No solution
x + 2y = 4; 2x + 4y = 801 / 1x = 4 โˆ’ 2t, y = t
2x + y โˆ’ z = 3; x โˆ’ y + 2z = 5; 3x + 2y + z = 10โˆ’103 / 3x = 2, y = 1, z = 2
x + y + z = 20000; 0.02x + 0.04y + 0.05z = 680; x โˆ’ 2z = 0โˆ’3/1003 / 3x = 8000, y = 8000, z = 4000
x + y + z = 6; 2x + 3y + z = 14; 3x + 4y + 2z = 2002 / 2x = 4 โˆ’ 2t, y = 2 + t, z = t
x + y + z = 6; 2x + 3y + z = 14; 3x + 4y + 2z = 2102 / 3No solution
x + y + z + w = 5; 2x โˆ’ y + z โˆ’ w = โˆ’4; x + 2y โˆ’ z + 2w = 12; 3x + y + 2z โˆ’ w = 0โˆ’144 / 4x = 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 = 802 / 2x = 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
2681.3
317392.3
4362045.7
5651,23519.0
61068,65881.7
8232623,5282,687.6
1043068,588,310159,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

Sources

Solving linear systems is deterministic mathematics, so every figure on this page follows from the methods themselves. The methods match these references:

โš ๏ธ 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.

Note: Answers are exact fractions computed from the equations you enter. Decimal approximations are shown next to fractions for convenience only.

❓ 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.

Related Calculators