Gauss-Jordan and Cramer's Rule Calculator
Each row is one equation: the coefficients of x, y, z, w, then the constant b on the right of the equals sign. Write 0 for a missing variable. Integers, decimals (2.5 or 2,5) and fractions (3/4) work.
| x | y | z | w | b |
|---|---|---|---|---|
Try an example:
Solution:
What the ranks say:
Gauss-Jordan step by step
Cramer's rule
Check in the original equations
Type a system of 2, 3 or 4 linear equations as an augmented matrix and the calculator solves it two ways. Gauss-Jordan elimination shows every row operation, with the matrix after each step, the pivot highlighted and every number kept as an exact fraction. Cramer's rule shows det(A) and each determinant it needs. It also tells you whether the system has one solution, none or infinitely many, and it checks the answer in your original equations.
Row operations are written like R2 → R2 − 3R1, which means: replace row 2 with row 2 minus 3 times row 1. And R1 ↔ R3 means: swap rows 1 and 3. Below the tool you will find how the method works, 4 worked examples, a table to read the final matrix and the most common questions.
How to use the Gauss-Jordan and Cramer calculator
Step 1: Choose the size of the system: 2×2, 3×3 or 4×4.
Step 2: Type each equation as one row: the coefficients of x, y, z and w, and then the constant b. If a variable is missing, write 0. You can use integers, decimals and fractions such as 3/4.
Step 3: The steps appear as you type, and also when you press the Calculate button or the Enter key. The example buttons load systems that show a row swap, fractions, no solution, infinitely many solutions and two free variables.
Step 4: Read the solution first. Then follow the Gauss-Jordan steps (the pivot is orange and the row that changed is blue), the Cramer determinants and the check in your original equations.
How Gauss-Jordan elimination works
The augmented matrix puts the coefficients on the left and the constants on the right of a vertical bar. Gauss-Jordan uses only three row operations, which never change the solutions of the system:
| Swap two rows: Ri ↔ Rj |
| Multiply a row by a number k that is not 0: Ri → kRi |
| Add a multiple of one row to another: Ri → Ri + kRj |
Work column by column. In each column, pick a pivot (if the pivot position holds 0, swap in a row below that does not), multiply its row so the pivot becomes 1, and then use it to turn every other entry in that column into 0, above and below. When every column has been handled, the left side is the identity matrix and the right side is the solution. Gaussian elimination stops with zeros only below the pivots and finishes with back-substitution. Gauss-Jordan keeps going until nothing is left to substitute.
Cramer's rule for 2×2, 3×3 and 4×4 systems
Write the system as A·x = b. When det(A) is not 0, each unknown is a quotient of determinants:
| xi = det(Ai) / det(A) |
Here Ai is the matrix A with column i replaced by the constants b. For a 2×2 matrix, det = ad − bc. For 3×3 and 4×4 the calculator expands along row 1 and shows each term. If det(A) = 0 the rule cannot be used, because it would divide by 0. Cramer's rule is practical for small systems, but it gets slow as the size grows, which is why large systems are solved by elimination.
How to read the reduced row echelon form
| What you see in the reduced matrix | What it means | Solutions |
|---|---|---|
| Every unknown has a pivot, a 1 with zeros around it | The last column holds the values of the unknowns | Exactly one |
| A row of zeros with a number that is not 0 on the right, like 0 0 0 | 1 | That row says 0 = a number that is not 0 | None |
| A row like 0 0 0 | 0 and fewer pivots than unknowns | At least one variable is free and can take any value | Infinitely many |
Gauss-Jordan and Cramer examples
Example 1: a 3×3 system with Gauss-Jordan
Solve 2x + y − z = 8; −3x − y + 2z = −11; −2x + y + 2z = −3. The augmented matrix goes through these 9 row operations:
- R1 → (1/2)R1
- R2 → R2 + 3R1
- R3 → R3 + 2R1
- R2 → 2R2
- R1 → R1 − (1/2)R2
- R3 → R3 − 2R2
- R3 → −R3
- R1 → R1 + R3
- R2 → R2 − R3
The reduced matrix has the identity on the left, so the solution is x = 2, y = 3, z = −1. Check the first equation: 2(2) + 1(3) + (−1)(−1) = 8.
Example 2: the same system with Cramer's rule
det(A) = 2·(−4) − 1·(−2) + (−1)·(−5) = −1
Because det(A) is not 0, Cramer's rule applies. Replacing each column with the constants gives det(Ax) = −2, det(Ay) = −3 and det(Az) = 1. So x = −2 / (−1) = 2, y = −3 / (−1) = 3 and z = 1 / (−1) = −1, the same answer as before.
Example 3: a system that needs a row swap
Solve 2y + z = 7; x + y + z = 6; 2x + y + 3z = 13. The entry in row 1 and column 1 is 0, so it cannot be a pivot. The first operation is R1 ↔ R2, and then the elimination goes on as usual:
- R1 ↔ R2
- R3 → R3 − 2R1
- R2 → (1/2)R2
- R1 → R1 − R2
- R3 → R3 + R2
- R3 → (2/3)R3
- R1 → R1 − (1/2)R3
- R2 → R2 − (1/2)R3
The solution is x = 1, y = 2, z = 3.
Example 4: infinitely many solutions
Solve x + y + z = 6; 2x − y + z = 3; 3x + 2z = 9. After 5 row operations the last row becomes 0 0 0 | 0. That row is 0 = 0 and it says nothing new, so only 2 equations really count for 3 unknowns. The variable z is free, and we call it t:
- x = 3 − (2/3)t
- y = 3 − (1/3)t
- z = t
Every value of t gives a solution. For t = 1, the first equation reads 1(7/3) + 1(8/3) + 1(1) = 6, as it should.
Frequently asked questions
What is the difference between Gaussian elimination and Gauss-Jordan?
Gaussian elimination reduces the matrix to a staircase shape and then finds the unknowns from the bottom up by back-substitution. Gauss-Jordan keeps reducing until the left side is the identity matrix, so the solution can be read directly from the last column. It takes a few more row operations but no back-substitution.
What do I do when the pivot is 0?
Swap that row with a row below it that has a nonzero entry in the same column. The calculator does this on its own and writes it as a swap, for example R1 ↔ R2 in example 3. If every entry below is also 0, that column has no pivot and the variable will be free or the system has no solution.
How can I tell no solution from infinitely many solutions?
Look at the rows of zeros in the reduced matrix. A row like 0 0 0 | 1 says 0 = 1, which is impossible, so there is no solution. A row like 0 0 0 | 0 is true for any values, so it is dropped, and if fewer pivots than unknowns remain, the free variables give infinitely many solutions.
When can I not use Cramer's rule?
When det(A) = 0, because the formula divides by det(A). Then the system has no solution or infinitely many. If one of the det(Ai) is not 0, there is no solution. If they are all 0, the determinants cannot decide, and elimination tells which. Cramer's rule also needs a square system, with as many equations as unknowns.
Can I type fractions and decimals?
Yes. Type 3/4, 0.75 or 0,75 and the calculator reads the exact value 3/4. All the arithmetic is done with exact fractions, so you never see rounding errors in the steps. The solution also shows a decimal next to each fraction.
Learn more
- Systems of equations 3x3: examples with answers
- Solving systems of equations by elimination
- Determinant of a 3x3 matrix
- Systems with no solution or infinitely many solutions
Related calculators
- 3x3 System of Equations Calculator
- 2x2 System of Equations Calculator
- Determinant Calculator
- Linear Equations Calculator
You can explore other calculators here.