MatrixCalc

Gaussian elimination calculator

Solve a system of linear equations by Gaussian elimination and read every row operation, written out as R2 → R2 − 3·R1. Enter the augmented matrix and follow the elimination to the answer.

Matrix A
rows: 3
cols: 3
Matrix B
rows: 3
cols: 3
Operations

Open the steps below to see the full answer.

Result
Pick an operation to see the result here. Errors will show up in this area.

Tips: adjust sizes (max 50×50). For A×B, cols(A)=rows(B). det/inverse/trace/power require square matrices.

React, Tailwind & shadcn/ui. No external math deps. — English

Gaussian elimination is the method every linear algebra course opens with: use row operations to drive the entries below each pivot to zero, then read the solution back. Enter your augmented matrix above, press Row echelon(A), and open the steps — each one is labelled with the operation that produced it.

How the method works

Three operations are allowed, and all three leave the solution set untouched: swap two rows, multiply a row by a non-zero number, and add a multiple of one row to another. The strategy is to pick the first column, use its top entry as a pivot, and subtract multiples of that row from the ones below until the column is zero beneath the pivot. Then move one column right, one row down, and repeat.

What comes out is row echelon form: a staircase of leading entries, zeros below. From there the last equation has one unknown, the one above it has two, and substituting backwards unwinds the whole system. Carrying on until the pivots are 1 and the entries above them are zero too gives reduced row echelon form, and the solution can be read directly — that is the RREF calculator.

Worked example

The system x + 2y − z = −4, 2x + 3y − z = −11, −2x − 3z = 22, written as an augmented matrix:

12−1−4
23−1−11
−20−322
12−1−4
0−11−3
00−12

The last row says −z = 2, so z = −2. Substituting upward gives y = 1 and then x = −8. The calculator uses partial pivoting — at each step it moves the largest available entry into the pivot position — which costs nothing in exact arithmetic and avoids catastrophic rounding in floating point.

Common mistakes

  • Multiplying a row by zero. It is not a legal row operation: it destroys an equation rather than rewriting it.
  • Working column by column instead of pivot by pivot. Once a column is cleared, later operations must not disturb it. Always work down and to the right.
  • Stopping at a zero row and calling the system unsolvable. A row of all zeros means a redundant equation, so there are infinitely many solutions. Only 0 = c with c non-zero means no solution.
  • Forgetting the constants column. Every operation applies to the full augmented row, right-hand side included.

Frequently asked questions

What is the difference between Gaussian and Gauss-Jordan elimination?
Gaussian elimination stops at row echelon form and finishes with back substitution. Gauss-Jordan carries on until the matrix is in reduced row echelon form, where the solution can be read off directly. Gauss-Jordan does more arithmetic for the same answer.
How do I enter a system of equations?
As an augmented matrix: one row per equation, one column per unknown, and a final column for the constants. A system of three equations in three unknowns is a 3×4 matrix.
What if a pivot position holds a zero?
Swap in a row below that has a non-zero entry in that column. If every row below is zero there too, that column has no pivot — its variable is free, and the system has infinitely many solutions.
Why does the calculator show fractions?
Elimination is done in exact rational arithmetic, so 1/3 stays 1/3 rather than drifting to 0.3333. You can switch the steps panel to decimals if you prefer.

Want the full explanation? Read the guide: Gaussian and Gauss-Jordan elimination explained

Other calculators