Omni Calculator logo

Welcome to Omni's Gauss-Jordan elimination calculator! Whether you've come here because you need to learn how to solve a linear system by the Gauss-Jordan elimination algorithm or instead you want to invert a matrix using this method, you're at the right place!

We will explain what the Gauss-Jordan elimination actually is and how it differs from the Gauss elimination, which you may have encountered earlier in your mathematical journey. Then we will tell you how to do the Gauss-Jordan elimination by hand or if you'd rather save some effort, how to use this Gauss-Jordan elimination calculator most efficiently.

🙋 The Gauss-Jordan elimination algorithm is especially popular in the context of solving systems of linear equations. In our dedicated tool, namely the reduced row echelon form calculator, we approach the Gauss-Jordan elimination method from this specific angle.

What is the Gauss-Jordan elimination method?

The Gauss-Jordan elimination method is a procedure where we convert a matrix into its reduced row echelon form by using only three specific operations, called elementary row operations.

The purpose of the Gauss-Jordan elimination method is, most often, to:

  • Solve a system of linear equations;
  • Inverse a matrix;
  • Compute the rank of a matrix; or
  • Compute the determinant of a matrix.

As you can see, several new notions appeared: row echelon, elementary operations, etc. Let's discuss them first, and then we will move on to discussing how to do the Gauss-Jordan elimination.

What is the (reduced) row echelon form of a matrix?

A matrix is in the row echelon form when:

  • For zero rows: they are all at the bottom of the matrix; and
  • For non-zero rows: the leftmost non-zero entry in a row (called the pivot or the leading coefficient) is to the right of the pivot of the row above.

A matrix is in reduced row echelon form if additionally:

  • Each pivot is equal to 1; and
  • Each pivot is the only non-zero coefficient in its column (there are only zeros above and below the pivot).

Examples

Matrices in the row echelon form (but not in the reduced row echelon form):

[123056007][450300120001]\begin{bmatrix} 1 & 2 & 3 \\ 0 &5 &6 \\ 0 &0 &7 \end{bmatrix} \quad \begin{bmatrix} 4 &5 &0 & 3\\ 0 & 0 & 1 & 2\\ 0 &0 &0 & 1 \end{bmatrix}
[113014][200101010000]\begin{bmatrix} 1 & 1 &3 \\ 0 &1 &4 \end{bmatrix} \quad \begin{bmatrix} 2 & 0 & 0& 1\\ 0 &1 &0& 1\\ 0 &0 &0&0 \end{bmatrix}

Matrices in the reduced row echelon form:

[103014][100300160000]\begin{bmatrix} 1 & 0 & 3 \\ 0 &1 &4 \end{bmatrix} \quad \begin{bmatrix} 1 & 0 & 0& 3\\ 0 &0 &1& 6\\ 0 &0 &0& 0 \end{bmatrix}

What are row operations in Gauss elimination?

Here we list the allowed row operations in the Gauss (and Gauss-Jordan) elimination:

  1. Swapping any two of the rows.

  2. Adding/subtracting a scalar multiple of one row to/from another row.

  3. Multiplying any of the rows by any (non-zero!) scalar.

Let's look at some examples:

  1. Swap the 1st row with the 2nd row:
[123456789]    [456123789]\quad \begin{bmatrix} 1 & 2 & 3 \\ 4 &5 &6 \\ 7 &8 &9 \end{bmatrix} \ \ \rightarrow \ \ \begin{bmatrix} 4 &5 &6 \\ 1 & 2 & 3 \\ 7 &8 &9 \end{bmatrix}
  1. Multiply the 1st row by 22:
[123456789]    [246456789]\quad \begin{bmatrix} 1 & 2 & 3 \\ 4 &5 &6 \\ 7 &8 &9 \end{bmatrix} \ \ \rightarrow \ \ \begin{bmatrix} 2 & 4 & 6 \\ 4 &5 &6 \\ 7 &8 &9 \end{bmatrix}
  1. Add the 1st row multiplied by -2 to the 2nd row:
[123456789]    [123210789]\quad \begin{bmatrix} 1 & 2 & 3 \\ 4 &5 &6 \\ 7 &8 &9 \end{bmatrix} \ \ \rightarrow \ \ \begin{bmatrix} 1 & 2 & 3 \\ 2 & 1 & 0 \\ 7 &8 &9 \end{bmatrix}

🙋 If you need a refresher on how to perform math operations (addition, multiplication, etc...) on matrix rows, visit our vector calculator.

Can you see how each of these operations helps us perform the Gauss-Jordan elimination? Let's see:

  1. By swapping rows, we can easily put the zero rows at the bottom of the matrix.

  2. The aim of adding/subtracting a scalar multiple of a row to/from another row is to turn the entries above and below the pivots into zeros.

  3. By multiplying a row by a scalar, you'll easily make the pivots equal to 1 – just multiply the pivot, equal to some p, by the scalar 1/p.

Gauss-Jordan elimination: 3×3 example

To see how the row operations introduced above work in practice, let's use them to solve the following 3×3 example by the Gauss-Jordan elimination:

{x+2y2z=12x+4y5z=42x+2y+3z=4\left\{ \begin{align*} x+2y-2z = 1\\ 2x+4y-5z = 4\\ 2x+2y+3z=4\\ \end{align*} \right.

The augmented matrix of this system reads:

[122124542234]\begin{bmatrix} 1 & 2 & -2 & 1\\ 2 & 4 & -5 & 4\\ 2 & 2 & 3 & 4\\ \end{bmatrix}

Let's subtract the 1st row multiplied by 22 from the 2nd row:

[122100122234]\begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & 0 & -1 & 2\\ 2 & 2 & 3 & 4\\ \end{bmatrix}

We've managed to produce zero in the 2nd row and 1st column! We do the same for the 3rd row and 1st column:

[122100120272] \begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & 0 & -1 & 2\\ 0 & -2 & 7 & 2\\ \end{bmatrix}

Perfect! In fact, as you can see, we've managed to produce two zeros in the 2nd row! Let's use this unexpected gift: we swap the 2nd and 3rd rows:

[122102720012]\begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & -2 & 7 & 2\\ 0 & 0 & -1 & 2\\ \end{bmatrix}

In this way, we've already obtained a row echelon form. From here, you can easily solve the system. Let's, however, stick to the Gauss-Jordan elimination and try to produce the reduced row echelon form.

First, we multiply the last row by 1-1 so that the pivot equals 11:

[122102720012] \begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & -2 & 7 & 2\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

And we multiply the 2nd row by 12-\frac 12 so that the pivot equals 11:

[1221017210012]\begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & 1 & -\frac 72 & -1\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

Next, we want to eliminate the non-zero element in the 1st row and 2nd column. To this end, from the 1st row we subtract the 2nd row multiplied by 22:

[1053017210012]\begin{bmatrix} 1 & 0 & 5 & 3\\ 0 & 1 & -\frac 72 & -1\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

Two more entries to eliminate: the above-diagonal elements in the 3rd column. You know what to do, right? From the 1st row we subtract the 3rd row multiplied by 55:

[10013017210012]\begin{bmatrix} 1 & 0 & 0 & 13\\ 0 & 1 & -\frac 72 & -1\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

And to the 2nd row we add the 3rd row multiplied by 72\frac 72:

[1001301080012]\begin{bmatrix} 1 & 0 & 0 & 13\\ 0 & 1 & 0 & -8\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

Yay, we're done! Our matrix is in the reduced row echelon form. In the last column, we see the solution to our linear system:

{x=13y=8z=2\left\{ \begin{align*} x = 13\\ y = -8\\ z =-2\\ \end{align*} \right.

How do I do the Gauss-Jordan elimination by hand?

Perform the Gauss-Jordan elimination as follows:

  1. Swap the rows so that there is a pivot (non-zero number) in the 1st row and 1st column.

  2. Multiply the first row so that the pivot becomes 1.

  3. Add/subtract multiples of the 1st row to/from the other rows to turn all the remaining entries of the 1st column are zeros.

  4. Swap rows to have a pivot in the 2nd row and 2nd column. Apply Steps 2 & 3.

  5. Repeat steps 2-4, moving along the main diagonal.

Hmmm.... so many steps! Performing the Gauss-Jordan elimination algorithm, even if straightforward, may be time-consuming. You surely have better ideas on how to use your free time, don't you? ;) Use our Gauss-Jordan elimination calculator to do your homework quickly and then move on to... other stuff.

How to use this Gauss-Jordan elimination calculator?

Omni's Gauss-Jordan elimination calculator is a very simple tool to use. Follow these steps:

  1. Input the coefficients of your matrix.

  2. Tell us whether you want the row echelon form or the reduced row echelon form as a result. We recommend the latter as the former is non-unique!

  3. The calculations go off immediately, and the result is displayed below the coefficient fields.

  4. Note you can use this calculator to generate as many 2×2 and 3×3 examples of Gauss-Jordan elimination as you wish.