Gaussian Elimination Calculator

Gaussian Elimination Calculator systematically transforms augmented matrices to row echelon or reduced forms, solving linear systems, computing rank, and consistency.

Type a matrix like [[...],[...]] or one row per line (comma/space separated). Expressions allowed: 1/2, sqrt(2), 3^2. If you check augmented, the last column is treated as b.
Controls display precision; internal math uses full precision.
When checked, last column is the RHS vector b.
Examples
Click an example to autofill the matrix, then press Calculate. Examples treat input as augmented.

Results

Equation (exact expression)
M = [[2,1,5],[1,-1,1]]
Row Echelon Form (REF)
REF(M) = [[1,0,2],[0,1,3]]
Reduced Row Echelon Form (RREF)
RREF(M) = [[1,0,2],[0,1,3]]
Solution
Unique solution: x = [2, 3]
Rows (m)
2
Columns (n)
3
Rank(A)
2
Rank(M)
2

Helping notes

  • Gaussian elimination performs forward elimination to REF; RREF (Gauss–Jordan) also eliminates above pivots.
  • If treated as augmented (A|b): unique ⇔ rank(A)=rank(M)=#vars; none ⇔ rank(A)<rank(M); infinite ⇔ rank(A)=rank(M)<#vars.
  • Decimal places affect formatting only.

What is a Gaussian Elimination Calculator?

A Gaussian Elimination Calculator performs the classic algorithm that converts a matrix into row echelon form (REF) or reduced row echelon form (RREF). For a system \(A\mathbf{x}=\mathbf{b}\), it operates on the augmented matrix \([A\mid \mathbf{b}]\) to create zeros beneath successive pivots, exposing rank, consistency, and—when appropriate—the unique or parametric solution. In REF, nonzero rows appear above zero rows and each pivot lies to the right of the pivot above; RREF further scales pivots to \(1\) and clears every pivot column. Gaussian elimination is fundamental in algebra, data science, engineering, and numerical computing because it unifies solving systems, determining rank, and understanding linear dependence in one systematic procedure.

$$\textbf{Augmented matrix:}\quad [A\mid \mathbf{b}] = \begin{bmatrix} a_{11}&\cdots&a_{1n}&\vline& b_1\\ \vdots & &\vdots &\vline& \vdots\\ a_{m1}&\cdots&a_{mn}&\vline& b_m \end{bmatrix}.$$

About the Gaussian Elimination Calculator

The calculator applies elementary row operations (EROs) to produce upper-triangular structure, optionally followed by back-substitution or full reduction to RREF. It supports arbitrary sizes \(m\times n\) and augmented systems. Pivots identify leading variables; non-pivot columns correspond to free variables. Rank is the number of pivots, \(\operatorname{rank}(A)=r\). Consistency is determined by comparing ranks of \(A\) and \([A\mid \mathbf{b}]\).

$$\textbf{EROs:}\quad R_i \leftrightarrow R_j,\qquad R_i \leftarrow k\,R_i\ (k\neq 0),\qquad R_i \leftarrow R_i + k\,R_j.$$ $$\textbf{Elimination step:}\quad \text{with pivot } a_{ii}\neq 0,\ \ R_j \leftarrow R_j - \frac{a_{ji}}{a_{ii}}\,R_i\quad(j>i).$$ $$\textbf{Rank/consistency:}\quad \operatorname{rank}(A)=\operatorname{rank}([A\mid \mathbf{b}])\Rightarrow \text{consistent};\ \operatorname{rank}(A)<\operatorname{rank}([A\mid \mathbf{b}])\Rightarrow \text{inconsistent}.$$

For best visual results, display formulas with MathJax; run arithmetic with math.js. When MathJax is configured with container-width line breaks, formulas wrap responsively.

How to Use this Gaussian Elimination Calculator

  1. Enter the matrix \(A\) (and \(\mathbf{b}\) if solving \(A\mathbf{x}=\mathbf{b}\)).
  2. Choose REF or RREF. The tool performs EROs to create zeros under each pivot.
  3. Read off pivots, \(\operatorname{rank}(A)\), and (for augmented input) whether the system is consistent.
  4. If consistent and \(r=n\), the solution is unique; if \(r<n\), express solutions with free parameters via RREF.
$$\textbf{Back-substitution (upper triangular):}\quad a_{nn}x_n=b_n',\ a_{n-1,n-1}x_{n-1}=b_{n-1}'-a_{n-1,n}x_n,\ \dots$$

Examples (using the same formulas)

Example 1 — Unique solution: System \( \begin{cases} 2x+y=5\\ 4x-2y=2\end{cases}\). $$\left[\begin{array}{cc|c}2&1&5\\4&-2&2\end{array}\right] \xrightarrow{R_2\leftarrow R_2-2R_1} \left[\begin{array}{cc|c}2&1&5\\0&-4&-8\end{array}\right].$$ Divide \(R_2\) by \(-4\): \([0\ 1\ |\ 2]\). Eliminate \(y\) from \(R_1\): \(R_1\leftarrow R_1-1\cdot R_2\Rightarrow [2\ 0\ |\ 3]\). Divide \(R_1\) by \(2\): \([1\ 0\ |\ 3/2]\). $$\text{RREF}= \left[\begin{array}{cc|c}1&0&\tfrac{3}{2}\\0&1&2\end{array}\right] \Rightarrow (x,y)=\left(\tfrac{3}{2},2\right).$$

Example 2 — Infinite solutions: \(x+2y-z=1,\ 2x+4y-2z=2,\ -x-2y+z=-1\). $$\left[\begin{array}{ccc|c} 1&2&-1&1\\ 2&4&-2&2\\ -1&-2&1&-1 \end{array}\right] \xrightarrow{R_2\leftarrow R_2-2R_1,\ R_3\leftarrow R_3+R_1} \left[\begin{array}{ccc|c} 1&2&-1&1\\ 0&0&0&0\\ 0&0&0&0 \end{array}\right].$$ One pivot \(\Rightarrow r=1<n=3\). Let \(y=s,\ z=t\). From \(x+2y-z=1\): \(x=1-2s+t\). $$\mathbf{x}=\big(1-2s+t,\ s,\ t\big),\ \ s,t\in\mathbb{R}.$$

Example 3 — Inconsistent: \(x+y=1,\ 2x+2y=3\). $$\left[\begin{array}{cc|c}1&1&1\\2&2&3\end{array}\right] \xrightarrow{R_2\leftarrow R_2-2R_1} \left[\begin{array}{cc|c}1&1&1\\0&0&1\end{array}\right].$$ Row \([0\ 0\ |\ 1]\) implies \(0=1\Rightarrow\) no solution; \(\operatorname{rank}([A\mid \mathbf{b}])=\operatorname{rank}(A)+1\).

More Math & Algebra Calculators