Row Space, Column Space, and Null Space: The Big Picture

Every matrix carries three fundamental subspaces baked into its structure. Understanding what those subspaces are, where they live, and how their dimensions connect is one of the most clarifying moments in a first linear algebra course.

At a Glance

What These Three Subspaces Are

What These Three Subspaces Are

A matrix A with m rows and n columns defines three vector spaces simultaneously. They describe, in different ways, what the matrix does as a linear transformation.

Row space is the span of A's row vectors. It lives in R^n (the same dimension as the columns of A, since each row has n entries). Any linear combination of the rows belongs to the row space.

Column space (sometimes called the range or image) is the span of A's column vectors. It lives in R^m (the same dimension as the rows of A, since each column has m entries). The column space answers a practical question: for which vectors b does the system Ax = b have a solution? Exactly those b that lie in the column space. Wikipedia's entry on row and column spaces states the dimension fact plainly: rank(A) = dim(row space) = dim(column space), regardless of the matrix's shape.

Null space (also called the kernel) is the set of all vectors x satisfying Ax = 0. It lives in R^n, the same space as the row space. Every solution to the homogeneous system belongs to the null space. As the Wikipedia article on the kernel of a linear map puts it, the kernel is "the set of solutions to the equation Ax = 0," and its dimension (the nullity) combines with the rank to account for every column of A.

Dimensions and the Rank-Nullity Theorem

Here is where the three subspaces click together. Define the rank of A as the number of pivot positions in its RREF. Then:

That last equation is the rank-nullity theorem: rank + nullity = n. The rank counts how many "independent directions" the matrix captures; the nullity counts how many are lost (collapsed to zero).

One fact surprises many students: the row space and column space always have the same dimension, even though they live in completely different ambient spaces (R^n vs R^m). The rank is a single number that describes both.

SubspaceLives inDimensionBasis from RREF
Row spaceR^nrankNonzero rows of RREF
Column spaceR^mrankPivot columns of original A
Null spaceR^nn - rankParametric solution vectors

To make the dimension arithmetic concrete, here is how rank and shape combine for a few common cases:

Matrix shape (m x n)Rank rdim(row space)dim(column space)dim(null space) = n - r
3 x 4, rank 22222
3 x 4, full rank (3)3331
4 x 3, rank 33330
5 x 5, rank 5 (invertible)5550
2 x 6, rank 22224

Notice the null space grows precisely as the rank falls short of n. A tall, full-column-rank matrix (like the 4 x 3, rank 3 row) always has a trivial null space, which is exactly the condition for Ax = 0 to have only the zero solution.

Finding All Three from RREF: A Worked Example

Take the matrix:

A = [ 1  2  0  1 ]
    [ 2  4  1  3 ]
    [ 0  0  1  1 ]

This is a 3x4 matrix, so m = 3 and n = 4.

Step 1: Row-reduce to RREF.

Subtract 2 times row 1 from row 2:

[ 1  2  0  1 ]
[ 0  0  1  1 ]
[ 0  0  1  1 ]

Subtract row 2 from row 3:

[ 1  2  0  1 ]
[ 0  0  1  1 ]
[ 0  0  0  0 ]

This is already RREF. Pivots sit in columns 1 and 3. Rank = 2. Nullity = 4 - 2 = 2.

Row space basis: Take the nonzero rows of the RREF directly:

v1 = [1, 2, 0, 1]
v2 = [0, 0, 1, 1]

These two vectors span the row space in R^4. A common mistake is reading the row space basis from the original matrix instead of the RREF. Row operations preserve the row space, so the RREF rows are correct. They are not a basis for the original rows, but they are a valid basis for the same subspace.

Column space basis: Pivot columns are columns 1 and 3. Pull those from the original matrix A (not the RREF):

c1 = [1, 2, 0]
c3 = [0, 1, 1]

These live in R^3. This is the critical rule: find a basis for the column space by looking at which columns are pivot columns in the RREF, then taking those columns from the original matrix. The RREF column vectors themselves are not generally valid column space bases for A.

Null space basis: Solve Ax = 0 using the RREF. Variables x1 and x3 are pivot (basic) variables; x2 and x4 are free. Set x2 = s and x4 = t.

From row 2: x3 + x4 = 0, so x3 = -t. From row 1: x1 + 2x2 + x4 = 0, so x1 = -2s - t.

The general solution:

x = s[-2, 1, 0, 0] + t[-1, 0, -1, 1]

The null space basis is:

n1 = [-2, 1,  0, 0]
n2 = [-1, 0, -1, 1]

Both live in R^4. Dimension check: 2 + 2 = 4 = n. The rank-nullity theorem holds.

Verify by direct substitution. Plug n1 = [-2, 1, 0, 0] into each row of A: row 1 gives (1)(-2) + (2)(1) + (0)(0) + (1)(0) = 0, row 2 gives (2)(-2) + (4)(1) + (1)(0) + (3)(0) = 0, row 3 gives (0)(-2) + (0)(1) + (1)(0) + (1)(0) = 0. All three check out, so n1 genuinely satisfies Ax = 0, not just the reduced version. The same check on n2 confirms row 1: (1)(-1) + (2)(0) + (0)(-1) + (1)(1) = 0, row 2: (2)(-1) + (4)(0) + (1)(-1) + (3)(1) = 0, row 3: (0)(-1) + (0)(0) + (1)(-1) + (1)(1) = 0. This substitution step, checking against the original A rather than the RREF, is worth doing every time; it catches sign errors in the free-variable back-substitution before they propagate.

Why the Column Basis Comes from the Original Matrix

This trips people up consistently. After row reduction, the column relationships are preserved but the actual column vectors change. The RREF tells you which columns are linearly independent (the pivot ones), but the actual basis vectors for the column space of A must come from A itself.

To put it concretely: the column space of the RREF is not the same subspace as the column space of A. Row operations change column spaces. They do not change row spaces or null spaces. A quick way to see why: row operations are just linear combinations of rows, so any vector reachable as a row combination before reduction stays reachable after. Columns have no such protection, because reduction mixes rows together, which is precisely what changes each column's actual entries.

Orthogonality Between the Subspaces

There is a deeper geometric structure here. The row space and null space of A are orthogonal complements in R^n. Every vector in the null space is perpendicular to every vector in the row space, and together they span all of R^n. The same relationship holds between the column space and the left null space (null space of A^T) in R^m. These four subspaces, two pairs of orthogonal complements, are the fundamental theorem of linear algebra, the framing MIT's Gilbert Strang uses throughout 18.06 Linear Algebra, Lecture 10: The Four Fundamental Subspaces.

For the example above, you can verify: dot n1 = [-2, 1, 0, 0] with v1 = [1, 2, 0, 1]: (-2)(1) + (1)(2) + (0)(0) + (0)(1) = 0. Same with n2 and v2: (-1)(0) + (0)(0) + (-1)(1) + (1)(1) = 0. Orthogonality confirmed.

A practical payoff of this orthogonality: it tells you the null space and row space never overlap except at the zero vector, which is why you can decompose any vector in R^n into a row-space part and a null-space part with no ambiguity. That decomposition underlies least-squares problems, where the goal is to find the row-space component closest to a target vector.

Knowing the Rank Tells You Almost Everything

Finding the rank is the central computation. Once you have the rank r and the matrix dimensions m and n, you know the dimension of every fundamental subspace without any further work. The RREF then hands you explicit bases, not just dimensions. That combination, dimensions from rank, basis vectors from RREF, is what makes row reduction such a powerful single procedure.

A useful sanity habit: before trusting any computed basis, check the dimension arithmetic first. If your row space basis has 2 vectors but your column space basis has 3, you have a computational error somewhere, because those two dimensions are never allowed to differ.

Frequently asked questions

Do the row space and column space always have the same dimension?

Yes. Both dimensions equal the rank of the matrix, regardless of whether the matrix is square, tall, or wide. A 3x7 matrix with rank 2 has a 2-dimensional row space in R^7 and a 2-dimensional column space in R^3.

Can the null space ever be just the zero vector?

Yes. When the rank equals n (the number of columns), the nullity is n - n = 0. The null space contains only the zero vector. This happens exactly when Ax = b has at most one solution for any b, which is the condition for A to have linearly independent columns.

Why do we use the original matrix to find the column space basis?

Row operations alter the individual column vectors while preserving which ones are linearly dependent. The pivot positions found in the RREF tell you the indices of a maximal linearly independent set of columns in A. Those same-indexed columns from A form the basis. Taking them from the RREF would give a basis for the RREF's column space, a different subspace.

How does the null space relate to solving Ax = b?

If Ax = b has one particular solution p, then every solution has the form x = p + h where h is any vector in the null space. The null space parametrizes the non-uniqueness. A unique solution exists only when the null space is trivial (dimension zero).

What is the left null space, and why does it matter?

The left null space of A is the null space of A^T (equivalently, all vectors y with y^T A = 0). It lives in R^m and is the orthogonal complement of the column space, mirroring how the ordinary null space complements the row space. Its dimension is m - rank. It shows up in least-squares regression, where the residual vector (actual data minus fitted values) always lands in the left null space of the design matrix, which is exactly why the residuals are orthogonal to every column of predictors.

If two matrices are row-equivalent, do they share all three subspaces?

Only two of the three. Row-equivalent matrices (related by elementary row operations) always share the same row space and the same null space, since neither is affected by row combinations. They generally do not share the same column space, which is precisely why the column space basis must be pulled from the original matrix rather than its RREF.