How to Find the Rank of a Matrix Using RREF

The rank of a matrix is one of the most useful numbers you can extract from it. It tells you how much "independent information" the matrix carries, and it connects directly to whether a system of linear equations has solutions. The cleanest way to find it is to row-reduce the matrix and count the pivots.

What Matrix Rank Actually Means

Rank is defined as the number of pivot positions in the matrix's reduced row echelon form. Equivalently, it equals the number of nonzero rows that remain after row reduction. Both descriptions point to the same thing: how many linearly independent rows the matrix contains.

A matrix with more columns than nonzero rows after reduction has redundant information baked in. Those zero rows are not accidents; they signal that some of the original rows were linear combinations of others.

One fact worth committing to memory: row rank always equals column rank. You might reduce a 3x5 matrix and find 2 pivot columns, and those same 2 pivots account for 2 linearly independent rows. The count is the same from either direction. This equality is not obvious from the definition, but it holds for every matrix over any field, and it means "the rank" is unambiguous regardless of which dimension you approach it from.

Full Rank vs. Rank-Deficient

A matrix is full rank when its rank equals the smaller of its two dimensions. For a 3x4 matrix, full rank means rank 3. For a 4x3 matrix, full rank means rank 3. Full-rank square matrices are invertible; full-rank rectangular matrices have either no free variables (full column rank) or no zero rows in RREF (full row rank).

A matrix is rank-deficient when its rank is strictly less than that smaller dimension. Rank deficiency shows up as zero rows at the bottom of the RREF. It also means the columns are linearly dependent, which connects directly to the rank-nullity theorem: if rank < n (number of columns), the null space is nontrivial and there are free variables.

How to Compute Rank Step by Step

The procedure is just row reduction:

  1. Write the matrix in augmented form if you are solving a system, or as a standalone matrix if you only need the rank.
  2. Use row operations (swap rows, scale a row, add a multiple of one row to another) to reach reduced row echelon form.
  3. Count the nonzero rows. That count is the rank.

No shortcuts required. The row operations do not change the rank, so any stage of reduction gives the same final count.

Worked Example 1: A Full-Rank 3x3 Matrix

Consider the matrix

A = | 1  2  1 |
    | 0  1  3 |
    | 2  3 -1 |

Start by eliminating below the first pivot in column 1. Subtract 2 times row 1 from row 3:

| 1  2   1 |
| 0  1   3 |
| 0 -1  -3 |

Now eliminate below the pivot in column 2. Add row 2 to row 3:

| 1  2  1 |
| 0  1  3 |
| 0  0  0 |

Back-substitute to clear above the pivot in column 2. Subtract 2 times row 2 from row 1:

| 1  0  -5 |
| 0  1   3 |
| 0  0   0 |

This is RREF. There are two nonzero rows and two pivot columns (columns 1 and 2). So:

rank(A) = 2

The matrix is rank-deficient. The third row became all zeros, meaning the original row 3 was a linear combination of rows 1 and 2 (specifically, 2·row1 - row2). The null space is nontrivial: column 3 is a free variable column, which means the nullity is 1, consistent with rank + nullity = 3.

Worked Example 2: A Full-Rank 2x3 Matrix

Now try a smaller matrix where full rank is achievable:

B = | 2  4  0 |
    | 1  1  3 |

Swap rows to put the simpler-looking row first (optional, but cleaner):

| 1  1  3 |
| 2  4  0 |

Subtract 2 times row 1 from row 2:

| 1  1  3 |
| 0  2 -6 |

Scale row 2 by 1/2:

| 1  1   3 |
| 0  1  -3 |

Subtract row 2 from row 1:

| 1  0   6 |
| 0  1  -3 |

This is RREF. Both rows are nonzero. Pivot columns are 1 and 2; column 3 is free.

rank(B) = 2

Since B has 2 rows and rank 2, it is full row rank. Every row survived reduction. This means the system Bx = b has a solution for every right-hand side b. The nullity is 3 - 2 = 1, so there is a one-parameter family of solutions whenever one exists.

Rank and Linear Independence

There is a tight connection between rank and linear independence. The columns of a matrix are linearly independent if and only if every column is a pivot column, i.e., rank equals the number of columns. The rows are linearly independent if and only if there are no zero rows in the RREF, i.e., rank equals the number of rows.

This gives a practical test: form a matrix whose rows (or columns) are your vectors, reduce to RREF, count pivots. If the pivot count matches the number of vectors you started with, the set is independent. If not, the zero rows tell you exactly which vectors are redundant.

Frequently Asked Questions

Can the rank of a matrix ever exceed its dimensions?

No. The rank of an m x n matrix is at most min(m, n). You cannot have more linearly independent rows than you have rows, and you cannot have more linearly independent columns than you have columns. Both constraints apply simultaneously, and the smaller one wins.

Does the rank change if I multiply the matrix by an invertible matrix?

No. Multiplying on the left or right by an invertible matrix is equivalent to applying invertible row or column operations, which preserve linear independence. The rank stays the same. This is why rank is called an intrinsic property of the matrix, not an artifact of a particular basis or representation.

What does a rank of zero mean?

Only the zero matrix has rank 0. Every nonzero matrix has at least one nonzero entry, which generates at least one nonzero row in RREF, giving a rank of at least 1. If you row-reduce a matrix and get all zero rows, the original matrix was the zero matrix.

How does rank relate to the column space?

The rank equals the dimension of the column space (also called the image) of the matrix. The pivot columns of the original matrix form a basis for that column space, so counting pivots gives you the dimension directly. This is why rank is sometimes described as the "dimension of the image," particularly in a linear-maps context.