What is the rank of a matrix?
Last updated: 2026-11-26
The rank of a matrix is the dimension of its column space: the number of independent directions among its columns. After row reduction, it is the number of pivots. A matrix can have many rows and columns and still have a small rank, because some of them are combinations of others.
Start learning No account needed
1. What counting pivots tells you
Columns without a pivot correspond to free variables, and their number is the dimension of the null space, called the nullity. The rank theorem says rank plus nullity equals the number of columns. Since each pivot takes its own row and column, the rank is at most the smaller of the two sizes. A matrix has full row rank when the rank equals the number of rows, and full column rank when it equals the number of columns. Dimension means the number of vectors in a basis; see span and basis.
2. A worked example: nine numbers, rank 2
The matrix below has no zero entry and no two equal rows. Predict its rank before you read on. The numbers come from scripts/what-is-a-matrix-rank-worked-example.py in the Professor Turing repository.
A, one row per line:
(1, 2, 3)
(4, 5, 6)
(7, 8, 9)
reduced row echelon form:
(1, 0, -1)
(0, 1, 2)
(0, 0, 0)
pivots: 2, so rank(A) = 2
rank of the transpose: 2
row 3 = 2*row 2 - row 1: True
column 3 = 2*column 2 - column 1: True
C (pivot columns of A) times R (nonzero reduced rows) equals A: True
nullity = 3 - 2 = 1, A (1, -2, 1) = (0, 0, 0)
b = (6, 15, 24): rank of A with b appended = 2
b = (6, 15, 25): rank of A with b appended = 3
eigenvalues of A: 16.12, 0.00, -1.12
N: rows (0, 1), (0, 0); rank 1; N times N is the zero matrix: True
a 100 by 100 matrix of rank 2: C and R hold 400 numbers, the full table 10000
The third row is twice the second minus the first, and the columns obey the same kind of relation. Two directions are enough to build either set.
3. Why row rank equals column rank
The rows of A are vectors with n entries and the columns are vectors with m entries, so it is surprising that the two sets span spaces of the same dimension. One way to see it in the example is the column-row factorization in the output. C holds the pivot columns of A, (1, 4, 7) and (2, 5, 8), and R holds the nonzero reduced rows, (1, 0, −1) and (0, 1, 2). C is 3 by 2, R is 2 by 3, and C R = A. The 2 columns of C are independent, since neither is a multiple of the other, and C R = A makes each column of A a combination of them. So the column space has dimension 2. The 2 rows of R are independent, since they begin (1, 0) and (0, 1). Row reduction builds them from the rows of A, and C R = A builds each row of A from them. So the row space also has dimension 2.
Margalit and Rabinoff prove the general case with the rank theorem and the fact that the null space is perpendicular to the row space: the row space dimension and the column space dimension both equal n minus the nullity.
4. What a low rank implies
Here the outputs Ax fill a plane inside three dimensional space. So Ax = b has a solution for b on that plane and none for b off it. For b = (6, 15, 24), appending b as a fourth column leaves the rank at 2, and there is a solution. For b = (6, 15, 25) the rank rises to 3, and there is none. When a solution exists here, adding a multiple of (1, −2, 1) gives another.
Low rank also allows shorter storage. A 100 by 100 matrix of rank 2, written as C R, needs a 100 by 2 table and a 2 by 100 table, which is 400 numbers instead of 10000.
5. A common misconception: rank counts the nonzero eigenvalues
For our A, the eigenvalues are about 16.12, 0 and −1.12, so there are two nonzero ones and the rank is 2. This pattern can fail. N, with rows (0, 1) and (0, 0), has rank 1. Since N times N is zero, an equation Nv = λv gives λ²v = 0, so the eigenvalues are 0, with no nonzero one.
What does hold for a square matrix: 0 is an eigenvalue exactly when the matrix is not invertible, and the eigenvectors for 0, together with the zero vector, form the null space. So the largest number of linearly independent eigenvectors for 0 is n minus the rank. See what are eigenvalues and eigenvectors.
6. Test yourself
Case 1. What is the rank of the matrix with rows (1, 2) and (2, 4)?
Answer to case 1
It is 1, since the second row is twice the first.
Case 2. A has rows (1, 0, 0) and (0, 1, 0). Find its rank and nullity.
Answer to case 2
The rank is 2 and the nullity is 3 − 2 = 1.
Case 3. What is the largest rank a 3 by 5 matrix can have, and what is the nullity then?
Answer to case 3
The rank is at most 3, and at rank 3 the nullity is 5 − 3 = 2.
To practice from memory, see how to test yourself. For exam preparation, see how to study for a math exam.
What the sources found, and their limits
Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra, section 2.9. It defines rank and nullity, counts them through pivot columns and free variables, and states the rank theorem. Source: The rank theorem, read on 2026-11-25.
The same book, section 6.2. It proves that row rank equals column rank. Source: Orthogonal complements, read on 2026-11-25.
The same book, section 5.1. It shows that 0 is an eigenvalue exactly when a square matrix is not invertible, and that the eigenspace for 0 is the null space. Source: Eigenvalues and eigenvectors, read on 2026-11-25.
Gilbert Strang and Cleve Moler, LU and CR Elimination. The paper factors a matrix of rank r into its first r independent columns times the r nonzero rows of its reduced form, and uses this to show that column rank equals row rank. Source: LU and CR Elimination (PDF), read on 2026-11-25.
Jim Hefferon, Linear Algebra, fourth edition, chapter two, section III.3. Exercise 3.40 states that a system has a solution exactly when appending b leaves the rank unchanged, and exercise 3.41 defines full row rank and full column rank. Source: Linear Algebra (PDF), read on 2026-11-25.
Limits: two textbooks and one paper, with selected passages read. The storage count, the examples and the self-test cases are ours.
How Professor Turing helps
Professor Turing is a tutor for adults learning any subject, in college or on their own. It asks you questions instead of giving the final answer, does not grade a bare guess, and remembers what you got wrong. No account is needed to start. It's an AI tutor, free to try.
Bring a matrix and say what you think its rank is. Its first reply asks how you got there, such as which columns have pivots, before it teaches anything. You must be 18 or older, and guest conversations are deleted 7 days after the last activity.
FAQ
Why does rank matter? It gives the dimension of the set of outputs Ax. The number of columns minus the rank is the dimension of the null space, which is the number of free variables when Ax = b has a solution.
Is rank the number of nonzero eigenvalues? Not in general. The matrix with rows (0, 1) and (0, 0) has rank 1 and no nonzero eigenvalue. For a square matrix, the largest number of linearly independent eigenvectors for the eigenvalue 0 equals the size minus the rank.
Start with what you're working on
Tell the tutor which matrix you are working on and let it ask you the questions.
Start learning No account needed
See also: what is the determinant of a matrix · all study guides