Skip to content

How to find the rank of a matrix

5 min read

Short answer

The rank of a matrix is the number of pivots in its row echelon form, which equals the number of independent rows and also the number of independent columns. To find it: row reduce, then count the nonzero rows. Rank tells you how many dimensions the matrix really uses, and the rank-nullity theorem says rank⁡+nullity⁡=\operatorname{rank}+\operatorname{nullity}= number of columns.

Steps1Row reduce the matrix to echelon form2Circle the pivot (first nonzero) in each row3Count the nonzero rows: that count is the rank4Nullity = number of columns − rankRank 3 means no redundancy; less than full rank means dependent rows
Row operations do not change the rank, so counting pivots after elimination is safe.

Why rows and columns agree

Row operations only replace rows by combinations of rows, so they do not change how many rows are independent. After reduction, the pivot rows are clearly independent and the pivot columns are too. The same number counts both, which is why a matrix and its transpose have the same rank.

What rank tells you

For an n×nn\times n matrix, rank nn (full rank) means invertible, determinant nonzero, and a unique solution to Ax=bA\mathbf x=\mathbf b. Lower rank means some information is lost: the columns span less than the whole space and the equation Ax=0A\mathbf x=\mathbf 0 has non-zero solutions.

Worked example

Find the rank of A=(123246101)A=\begin{pmatrix}1&2&3\\2&4&6\\1&0&1\end{pmatrix}.

Row 2 minus 2×2\timesrow 1 gives (0,0,0)(0,0,0). Row 3 minus row 1 gives (0,−2,−2)(0,-2,-2). Swapping rows to tidy: (1230−2−2000).\begin{pmatrix}1&2&3\\0&-2&-2\\0&0&0\end{pmatrix}. Two nonzero rows, so rank⁡A=2\operatorname{rank}A=2. With 3 columns, the nullity is 3−2=13-2=1 (and indeed det⁡A=0\det A=0).

Try it yourself

What is the rank of (1236)\begin{pmatrix}1&2\\3&6\end{pmatrix}, and what does it mean for the solutions of Ax=0A\mathbf x=\mathbf 0?

Show the answer

Row 2 −3×-3\timesrow 1 is zero, so the rank is 1. Nullity is 2−1=12-1=1, so Ax=0A\mathbf x=\mathbf 0 has a line of solutions, spanned by (−2,1)(-2,1).

Keep going with practice

Rank and row reduction are practiced in Vidi's Linear Algebra & Probability course, and the matrix calculator shows the rank of any matrix you enter.