Gauss-Jordan Elimination Calculator
Enter the coefficients of your linear system and this calculator performs Gauss-Jordan elimination to full reduced row echelon form (RREF). It shows every row operation, reports the rank and nullity, and tells you whether the system has a unique solution, infinitely many solutions, or no solution. Supports 2x2, 3x3, and 4x4 augmented matrices.
What is Gauss-Jordan elimination?
Gauss-Jordan elimination is a systematic method for solving systems of linear equations by transforming the augmented matrix of the system into reduced row echelon form (RREF) using three types of elementary row operations: swapping two rows, multiplying a row by a nonzero constant, and adding a multiple of one row to another. Unlike plain Gaussian elimination, which stops at upper-triangular (row echelon) form and then uses back-substitution, Gauss-Jordan continues until every pivot column has exactly one nonzero entry. This means the solution can be read directly from the final matrix without any additional arithmetic. The method is named after Carl Friedrich Gauss, who developed the forward elimination phase, and Wilhelm Jordan, who extended it to the full reduction.
Reduced row echelon form (RREF) explained
A matrix is in reduced row echelon form when four conditions hold: (1) any rows consisting entirely of zeros appear at the bottom; (2) the first nonzero entry in each nonzero row, called the pivot or leading 1, equals exactly 1; (3) pivots move strictly right as you go down the rows; and (4) every column containing a pivot has zeros in all other positions, not just below. Condition (4) is what distinguishes RREF from ordinary REF and is what lets you read off the solution without back-substitution. Every matrix has a unique RREF, so two systems with the same solution set will reduce to the same RREF.
Rank, nullity, and the rank-nullity theorem
The rank of a matrix is the number of pivot positions in its RREF, which equals the number of linearly independent rows (or columns). For an n x n square coefficient matrix, rank = n means the matrix is invertible and the system has exactly one solution. If rank < n, the system either has no solution (when the RREF reveals a contradiction like 0 = 1) or infinitely many solutions (when some variables are free). The nullity is n minus the rank, and it counts the number of free variables in the solution set. The rank-nullity theorem states that rank plus nullity always equals the number of columns in the coefficient matrix, which is a fundamental constraint that any elimination process must satisfy.
Three possible outcomes of a linear system
Every system of linear equations falls into exactly one of three categories. A unique solution exists when the rank of the augmented matrix equals the rank of the coefficient matrix and both equal the number of unknowns - in geometric terms, the lines or planes intersect at exactly one point. Infinitely many solutions exist when the ranks are equal but smaller than the number of unknowns, meaning some equations are redundant and free variables exist. No solution (inconsistent system) exists when the rank of the augmented matrix exceeds the rank of the coefficient matrix - this happens when a contradiction such as 0 = 5 appears after elimination, meaning the equations describe parallel or skew objects that never meet. Gauss-Jordan elimination detects and handles all three cases automatically.
Row operations and what they do
| Operation | Notation | Effect on the solution set |
|---|---|---|
| Swap two rows | Ri <-> Rj | None - reorders equations |
| Scale a row by a nonzero constant | Ri = k * Ri (k != 0) | None - multiplies an equation through |
| Add a multiple of one row to another | Ri = Ri + k * Rj | None - adds a multiple of one equation to another |
These are the three elementary row operations used in Gauss-Jordan elimination.
Frequently asked questions
What is the difference between Gaussian elimination and Gauss-Jordan elimination?
Gaussian elimination reduces the augmented matrix to row echelon form (REF), where all entries below each pivot are zero. You then find the solution by back-substitution, working upward from the last equation. Gauss-Jordan elimination goes further, continuing to eliminate entries above each pivot as well, until the matrix reaches reduced row echelon form (RREF). The solution is then visible directly in the final matrix without any back-substitution. Gauss-Jordan does slightly more work but is easier to read and is the standard approach for inverting matrices.
How do I know if a system has no solution or infinitely many solutions?
After row reduction, look at the RREF of the augmented matrix. If any row has all zeros in the coefficient columns but a nonzero value in the constant column, the system is inconsistent and has no solution. If the rank of the coefficient matrix is less than the number of unknowns and no contradiction row exists, the system has infinitely many solutions, with one free variable for each unit of nullity (= n minus rank).
Can Gauss-Jordan elimination fail or give a wrong answer?
The method is mathematically exact for rational coefficients, but floating-point arithmetic introduces small rounding errors. This calculator uses partial pivoting, always choosing the row with the largest absolute value in the pivot column, which minimizes numerical instability. You may see tiny near-zero values like 0.000000001 instead of exactly 0 - these are rounded to zero automatically. For exact results with large or fractional coefficients, work with exact fractions rather than decimals.
What are elementary row operations and why do they not change the solution?
The three elementary row operations are: swapping two rows (which just reorders the equations), multiplying a row by a nonzero constant (which scales an equation without changing what it says), and adding a multiple of one row to another (which combines equations in a way that preserves all solutions). Because each operation is reversible and does not introduce or destroy solutions, the final RREF is equivalent to the original system - it has exactly the same solution set.
Can I use this calculator to find a matrix inverse?
Yes, indirectly. To invert an n x n matrix A, form the augmented matrix [A | I] where I is the n x n identity matrix, then apply Gauss-Jordan elimination. If A is invertible (rank = n), the result will be [I | A-inverse], so the right-hand side of the RREF gives you the inverse. This calculator is set up for linear systems (one RHS column), so you would need to run it separately for each column of the identity matrix, or use a dedicated matrix inverse calculator.
What does rank tell me about my system?
The rank of the coefficient matrix is the number of truly independent equations in your system. If rank equals n (the number of unknowns), you have enough independent information to pin down a unique solution. If rank is less than n, some equations are linear combinations of the others and the system is either underdetermined (infinitely many solutions) or inconsistent. Rank also determines whether the coefficient matrix is invertible: a square n x n matrix is invertible if and only if its rank equals n.