Matrix Calc. › Matrix rank calculator

Matrix rank calculator with row reduction

The rank of a matrix is how much of it is actually independent. Here it is computed from the row reduction, with each row operation written down.

What rank means

The rank is the number of genuinely independent rows — equivalently, the number of independent columns, which is the same number. A row that is a combination of the others adds no information: it describes the same constraint restated, so it does not raise the rank.

That makes rank the honest measure of how much a matrix tells you. A system of equations whose coefficient matrix has rank r carries r independent constraints, however many rows were typed.

Formally, the rank is the number of non-zero rows in the row-reduced echelon form — the count of pivots. It is also the dimension of the column space, and the size of the largest square submatrix with a non-zero determinant.

Rank, nullity and the sizes that bound them

rank + nullity = number of columns

This is the rank–nullity theorem. The nullity is the dimension of the null space — the directions the matrix sends to zero. Knowing one gives you the other, which is a cheap check: if the calculator reports a rank of 2 for a 3-column matrix, the null space must be a line.

The rank can never exceed the smaller of the row and column counts. A 3×5 matrix can have rank at most 3, so two of its five columns are always redundant.

Worked example

A = ⎡ 1  2  3 ⎤
    ⎢ 2  4  6 ⎥
    ⎣ 1  1  1 ⎦

R2 ← R2 − 2·R1
R3 ← R3 − R1
⎡ 1  2  3 ⎤
⎢ 0  0  0 ⎥
⎣ 0 −1 −2 ⎦

swap R2, R3
⎡ 1  2  3 ⎤
⎢ 0 −1 −2 ⎥
⎣ 0  0  0 ⎦

R2 ← −R2
⎡ 1  2  3 ⎤
⎢ 0  1  2 ⎥
⎣ 0  0  0 ⎦

R1 ← R1 − 2·R2
⎡ 1  0 −1 ⎤
⎢ 0  1  2 ⎥
⎣ 0  0  0 ⎦

rank = 2

The second row was exactly twice the first, so it vanished in one step — that is what dependence looks like in a reduction. Two pivots remain, so the rank is 2.

With three columns, rank 2 means the nullity is 1: there is exactly one independent direction sent to zero. Read it off the reduced form — x₃ is free, set it to 1, then x₁ = 1 and x₂ = −2:

v = (1, −2, 1)

A·v = (1 − 4 + 3,
       2 − 8 + 6,
       1 − 2 + 1)
    = (0, 0, 0)   ✓

When the answer is the obvious one

  • Square and invertible: rank equals the size. The determinant is non-zero and every row is independent.
  • A zero row or column: the rank drops by at least one immediately.
  • Two proportional rows: one of them is redundant, so the rank is at most one less than the row count.
  • A single non-zero entry: the rank is 1, wherever that entry sits.

What the calculator adds

It carries out Gauss–Jordan elimination and lists each operation — the row being replaced, the multiple, and the result — so the answer is the end of an argument rather than a number. It also reports the null space, which is the other half of the rank–nullity pair.

Questions

Is rank the same for rows and columns?

Yes. Row rank and column rank are always equal, which is why "the rank" is unambiguous even though a matrix has different numbers of rows and columns.

What is full rank?

A rank equal to the smaller dimension. A square matrix with full rank is invertible; a taller or wider matrix with full rank has linearly independent rows or columns respectively.

Does it work for rectangular matrices?

Yes, and that is where rank is most useful — a rectangular matrix has no determinant, so rank is the only way to say how independent it is.

How is it different from the determinant?

The determinant exists only for square matrices and only answers "zero or not really". Rank works at any shape and counts how many independent directions there are.

Can I see the row operations?

Yes. Every row operation is listed in order, so the reduction can be followed or checked line by line.

Reduce one now.

Free, offline, every row operation shown.