The rank nullity theorem, which Interactive Linear Algebra calls simply the rank theorem, says that for any matrix $A$ with $n$ columns, $$\operatorname{rank}(A) + \operatorname{nullity}(A) = n.$$ The rank is the dimension of the column space, the set of all outputs $A\mathbf{x}$. The nullity is the dimension of the null space, the set of inputs $\mathbf{x}$ with $A\mathbf{x} = \mathbf{0}$. In words: every input direction either shows up in the output or gets sent to zero, and the two counts add up to the number of input directions.
Without the fog
Picture a machine that takes vectors with $n$ entries and returns $A\mathbf{x}$. The rank counts how many independent output directions the machine can produce. The nullity counts how many independent input directions it flattens to nothing. Interactive Linear Algebra puts the trade off this way: the more freedom there is in choosing $\mathbf{x}$, the less freedom there is in the outputs, and the reverse. You cannot gain dimensions; you can only spend them on one side or the other.
Why it is true: count pivots
Row reduce $A$. Interactive Linear Algebra shows two facts from earlier sections:
- The rank equals the number of pivot columns.
- The nullity equals the number of free variables, which is the number of columns without a pivot.
Every column either has a pivot or does not, so the two counts add up to $n$. That is the whole proof. The theorem looks deep because it links two different subspaces, but the bookkeeping is just counting columns.
Worked example 1: a 2 by 3 matrix
Let $$A = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \end{pmatrix}.$$ The second row is twice the first, so row reduction leaves one nonzero row, $(1, 2, 3)$. There is one pivot, in column 1, so the rank is 1. The column space is the line in the plane spanned by $(1,2)$. With $n = 3$ columns, the theorem says the nullity is $3 - 1 = 2$.
Check directly. $A\mathbf{x} = \mathbf{0}$ means $x_1 + 2x_2 + 3x_3 = 0$, with $x_2$ and $x_3$ free. So $x_1 = -2x_2 - 3x_3$, and the null space is spanned by $(-2, 1, 0)$ and $(-3, 0, 1)$. Both vectors satisfy the equation: $-2 + 2 = 0$ and $-3 + 3 = 0$. Two independent vectors means a plane, so the nullity is 2, as predicted.
Worked example 2: a square matrix that is not invertible
Use the three vectors from linear independence explained as columns: $$B = \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 2 \end{pmatrix}.$$ The third column is the sum of the first two, so there are two pivots and the rank is 2. The theorem gives nullity $3 - 2 = 1$. Indeed, $1 \cdot (1,0,1) + 1 \cdot (0,1,1) - 1 \cdot (1,1,2) = (0,0,0)$, so the null space is the line spanned by $(1, 1, -1)$. Since the nullity is not zero, $\det B = 0$, which matches the determinant explainer: the map flattens space onto a plane.
Worked example 3: a wide matrix, no row reduction needed
Suppose $C$ is any $3 \times 5$ matrix. Its column space sits inside three dimensional space, so the rank is at most 3. The theorem then says the nullity is at least $5 - 3 = 2$. Without computing anything, you know that $C\mathbf{x} = \mathbf{0}$ has infinitely many solutions, forming at least a plane of them. This is the kind of qualitative conclusion Interactive Linear Algebra highlights: the theorem says something about a system without solving it.
The linear map version
For a linear map $T : V \to W$ on a finite dimensional space $V$, the same statement reads $$\dim V = \dim \ker T + \dim \operatorname{im} T.$$ For example, let $T$ take a polynomial of degree at most 3 to its derivative. The domain has dimension 4, with basis $1, x, x^2, x^3$. The kernel is the constants, dimension 1. The image is every polynomial of degree at most 2, dimension 3. And $1 + 3 = 4$.
What it tells you about solutions
- Nullity 0 means the columns are independent and each consistent system $A\mathbf{x} = \mathbf{b}$ has exactly one solution.
- Nullity $k > 0$ means every consistent system has a $k$ dimensional family of solutions: one particular solution plus anything in the null space.
- Square matrices. For an $n \times n$ matrix, rank $n$, nullity 0, a nonzero determinant and invertibility all say the same thing.
- Four subspaces. Gilbert Strang's MIT 18.06 lecture on the four fundamental subspaces pairs this with the row space and left null space: the row space also has dimension equal to the rank.
Checkpoints
- A $4 \times 6$ matrix has rank 4. What is its nullity?
- Can a $5 \times 3$ matrix have nullity 0? Can it have rank 4?
- Find the rank and nullity of $\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}$ and give a basis for its null space.
- A linear map from a 7 dimensional space has a 3 dimensional image. What is the dimension of its kernel?
Common mistakes
- Using the number of rows. The theorem counts columns, the dimension of the input space, not rows.
- Taking rank from the reduced matrix's columns as a basis. The count of pivots is right, but a basis for the column space comes from the pivot columns of the original matrix.
- Calling nullity the number of zero rows. Zero rows after reduction relate to the rows, not to free variables. Count columns without pivots.
- Forgetting finite dimensions. The linear map version needs a finite dimensional domain.
Related reading
- Linear independence explained and row reduction (RREF) intuition
- What a determinant means geometrically and eigenvalues in plain language
- Linear algebra topic map and the linear algebra first course pathway
- Glossary: span, basis, linear map, all explainers and the sources page
Related tools
The RREF calculator shows the pivot columns, so you can read off rank and nullity. Predict both numbers before you press the button.
Sources
- Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra, Section 2.9 The Rank Theorem (retrieved 12 Nov 2026)
- Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra, Section 2.7 Basis and Dimension (retrieved 12 Nov 2026)
- MIT OpenCourseWare, 18.06 Linear Algebra (Spring 2010), Gilbert Strang, Lecture 10: The four fundamental subspaces (retrieved 12 Nov 2026)
Last reviewed: 12 November 2026.
Common questions
What does the rank nullity theorem say?
For a matrix A with n columns, the rank of A plus the nullity of A equals n. The rank is the dimension of the column space and the nullity is the dimension of the null space.
How do you find the rank and nullity of a matrix?
Row reduce the matrix. The number of pivot columns is the rank. The number of columns without a pivot, which is the number of free variables, is the nullity.
What does nullity zero mean?
It means the only solution of Ax = 0 is x = 0, so the columns are linearly independent and the map x to Ax is one to one.
Why must a wide matrix have a nonzero null space?
A matrix with more columns than rows has rank at most the number of rows, so by the rank nullity theorem its nullity is at least the number of columns minus the number of rows, which is positive.