🧮
🧮 Math & statistics

RREF & Rank Calculator

Results update as you type.

Your numbers

Understanding the RREF and rank calculator — concept and principle

This calculator reduces a matrix to reduced row echelon form (RREF) and reads off its rank and nullity. RREF is the cleanest way to see the structure of a linear system: which variables are determined, which are free, whether the equations are consistent, and whether a set of vectors is linearly independent. Rank also reveals redundant variables in data.

Reducing [1 2 3; 4 5 6; 7 8 9] to RREFRow operations give RREF [1 0 −1; 0 1 2; 0 0 0]: two pivots, so rank 2, and one free column, nullity 1.Row steps reveal the rank123456789RREF10−1012000pivotpivotall 0R2 − 4·R1, R3 − 7·R1, R2 ÷ (−3)R3 + 6·R2, R1 − 2·R2row 3 = 2·row 2 − row 1, so it adds nothingx₁pivotx₂pivotx₃freerank = 2nullity = 3 − 2 = 1
Two pivots survive and the third row vanishes: rank 2, with one free variable.

How it is calculated

The calculator applies Gauss-Jordan elimination with three row operations: swap two rows, multiply a row by a non-zero number, and add a multiple of one row to another. It works column by column, choosing a non-zero pivot, scaling it to 1 and clearing every other entry in that column. The result is RREF, in which:

Rank = number of pivots. Nullity = number of columns − rank (the rank-nullity theorem).

The principle

Row operations never change the set of solutions of Ax = 0, nor the row space, so the RREF keeps all the information you need while making it easy to read. Each pivot marks one genuinely independent equation; a zero row reveals an equation that was a combination of the others. Columns without pivots correspond to free variables, and each free variable adds one dimension to the null space. The RREF of a matrix is unique, so any correct method gives the same answer.

Worked example

  1. Default: A = [1 2 3; 4 5 6; 7 8 9].
  2. R2 − 4·R1 gives [0 −3 −6]; R3 − 7·R1 gives [0 −6 −12].
  3. Divide R2 by −3: [0 1 2]. Then R3 + 6·R2 = [0 0 0].
  4. Clear above the second pivot: R1 − 2·R2 = [1 0 −1].
  5. RREF = [1 0 −1; 0 1 2; 0 0 0], with two pivots, so rank = 2 and nullity = 3 − 2 = 1.

The free variable x₃ = t gives x₁ = t and x₂ = −2t, so (1, −2, 1) spans the null space: indeed row 1 − 2·row 2 + row 3 = 0.

How to read the result

For an n×n matrix, rank n means it is invertible; anything less means det = 0. For a system [A | b], it is consistent exactly when adding b does not raise the rank; if rank equals the number of unknowns, the solution is unique, otherwise there are infinitely many solutions with "nullity" free parameters.

Common mistakes

Keep in mind: Rank is sensitive to rounding for nearly dependent data. With measured values, a matrix may look full rank only because of noise; numerical methods such as the singular value decomposition use a tolerance for this.

Frequently asked questions

Is the rank of A the same as the rank of Aᵀ?

Yes. Row rank always equals column rank.

Does the RREF depend on the order of operations?

No. Every matrix has exactly one RREF.

What does nullity 0 mean?

Ax = 0 has only the trivial solution x = 0, so the columns are linearly independent.

Sources: Gilbert Strang, Introduction to Linear Algebra, Wellesley-Cambridge Press — elimination and the four subspaces · David C. Lay, Linear Algebra and Its Applications, Pearson

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →