Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Four Fundamental Subspaces


One row reduction gives a basis for the column space, row space, null space and left null space, and the rank fixes all four dimensions.

Preset?An m×n matrix has four subspaces attached to it. The column space, in Rᵐ, is everything A can output; the null space, in Rⁿ, is everything A sends to zero. The row space, in Rⁿ, is spanned by the rows, and the left null space, in Rᵐ, is the null space of Aᵀ. Row reduction finds all four: the rank r is the number of pivots, the column space has dimension r, the null space n − r, the row space r, the left null space m − r. Row space and null space are perpendicular complements in Rⁿ; column space and left null space are perpendicular complements in Rᵐ.
Size
A3×3
Entries of A
A3×3
1
2
1
2
4
3
3
6
4
Step 1 / 8

Step explanations

1The four fundamental subspaces of a 3×3 matrix
A maps Rⁿ = R³ to Rᵐ = R³. Two subspaces live in the input space R³: the row space, spanned by the rows, and the null space, the solutions of Ax = 0. Two live in the output space R³: the column space, spanned by the columns — everything A can produce — and the left null space, the solutions of Aᵀy = 0. One row reduction finds a basis for each and the rank r that fixes all four dimensions.
Two subspaces in the input space, two in the output space, one row reduction for all four. Learn more about the first step · the big picture








Key Terms

Column space C(A)C(A) — all combinations of the columns of AA; the set of b\mathbf{b} for which Ax=bA\mathbf{x} = \mathbf{b} is solvable. A subspace of Rm\mathbb{R}^m of dimension rr.

Null space N(A)N(A) — all solutions of Ax=0A\mathbf{x} = \mathbf{0}. A subspace of Rn\mathbb{R}^n of dimension nrn - r.

Row space C(AT)C(A^T) — all combinations of the rows of AA. A subspace of Rn\mathbb{R}^n of dimension rr.

Left null space N(AT)N(A^T) — all solutions of ATy=0A^T\mathbf{y} = \mathbf{0}, equivalently yTA=0\mathbf{y}^TA = \mathbf{0}. A subspace of Rm\mathbb{R}^m of dimension mrm - r.

Rank rr — the number of pivots of AA; the common dimension of the column and row spaces.

Pivot columns — the columns of AA (not of RR) at pivot positions; a basis of the column space.

Special solutions — one null-space vector per free column, with that free variable 11 and the others 00.

Rank–nullityr+dimN(A)=nr + \dim N(A) = n; applied to ATA^T, r+dimN(AT)=mr + \dim N(A^T) = m.

Orthogonal complementN(A)=C(AT)N(A) = C(A^T)^\perp in Rn\mathbb{R}^n and N(AT)=C(A)N(A^T) = C(A)^\perp in Rm\mathbb{R}^m.

Getting Started with the Visualizer

Choose a matrix and watch one row reduction produce a basis for each of its four subspaces.

• Use the Preset pills for seven matrices: a 3×33 \times 3 of rank 22 with every subspace non-trivial, a rank-one matrix, wide and tall matrices of full rank, an invertible matrix, a 4×34 \times 3 of rank 22, and the zero matrix
• Use the two Size steppers for any shape from 2×22 \times 2 to 4×44 \times 4, and Shuffle for a random matrix that usually carries a planted dependency
• Edit any entry directly
• Hover the ? icon for a reminder of the four spaces and their dimensions
• Press play or step manually; the step log on the right keeps every stage

Each subspace scene shows a basis and, for the two null spaces, the product that proves the basis vectors are in the space. The last two scenes show the orthogonality between the pairs and the dimension count.

The Scenes in Order

The visualizer follows the textbook procedure exactly.

Row reduceARA \to R with the pivots and free columns marked; the rank rr is the number of pivots
Column space — the pivot columns of the original AA, with each free column expressed as a combination of them using the entries of RR
Row space — the non-zero rows of RR
Null space — one special solution per free column, scaled to integers, with AN=0AN = 0 shown as a matrix product
Left null spaceATA^T row reduced and its special solutions read off, with ATL=0A^TL = 0 shown
Orthogonality — the rows of AA times the null-space basis, and the column-space basis transposed times the left-null basis, both zero matrices
Done — the four dimensions, the two rank–nullity counts, and what they say about solving Ax=bA\mathbf{x} = \mathbf{b}

When a null space is trivial the scene says so and shows {0}\{\mathbf{0}\} in place of a basis.

Row Reduction First

Everything starts with the reduced row echelon form. The frozen picture below shows the default preset reduced to RR with two pivots, in columns 11 and 33, and column 22 free.

The rank 22 is now known, and with it the dimensions of all four subspaces: 22, 11, 22, 11.
A3×3121243364R = rref(A)3×3120001000
Row reduction, frozen

The default preset reduced to R = [1, 2, 0; 0, 0, 1; 0, 0, 0]: pivots in columns 1 and 3, column 2 free, rank 2. All four dimensions follow: 2, 1, 2, 1.

Row reduction is a sequence of invertible row operations, R=EAR = EA for an invertible EE. Two things follow. The row space is unchanged, since the rows of RR are combinations of the rows of AA and vice versa. And the null space is unchanged, since Ax=0A\mathbf{x} = \mathbf{0} and EAx=0EA\mathbf{x} = \mathbf{0} have the same solutions.

The column space is changed, in general, but the dependencies among the columns are not: Ax=0A\mathbf{x} = \mathbf{0} and Rx=0R\mathbf{x} = \mathbf{0} are the same statement. So the columns of AA at the pivot positions of RR are independent, and every other column of AA depends on them by the same coefficients that appear in RR.

The Column Space

The frozen picture below shows the column-space basis of the default preset: the pivot columns of AA, (1,2,3)(1, 2, 3) and (1,3,4)(1, 3, 4), with the free column greyed.

The free column is 22 times the first pivot column, and the number 22 is read straight from RR.
A3×3121243364basis of C(A)3×2112334
Column space, frozen

The pivot columns of A, (1, 2, 3) and (1, 3, 4), form the basis; the free column, greyed, is 2 times the first, as R says. A plane in R³.

The column space is the set of all AxA\mathbf{x}, so it is exactly the set of right-hand sides b\mathbf{b} for which Ax=bA\mathbf{x} = \mathbf{b} can be solved. For this matrix it is a plane in R3\mathbb{R}^3, and a system with a b\mathbf{b} off that plane has no solution.

Because AxA\mathbf{x} is the combination of the columns with coefficients x1,,xnx_1, \ldots, x_n, the dependent columns add nothing to the span; the pivot columns alone reach every point the full set does, and they do so independently, which is what a basis means.

The Row Space

The frozen picture below shows the row-space basis of the default preset: the non-zero rows of RR, (1,2,0)(1, 2, 0) and (0,0,1)(0, 0, 1), with the zero row greyed.

The rows of AA span the same plane; RR just presents it in its simplest basis.
R3×3120001000basis of C(Aᵀ), as rows2×3120001
Row space, frozen

The non-zero rows of R, (1, 2, 0) and (0, 0, 1). Row operations do not change the row space, so this is the row space of A in its simplest basis.

The row space has the same dimension as the column space, always. That is not obvious from the definitions, since one lives in Rn\mathbb{R}^n and the other in Rm\mathbb{R}^m, but row reduction proves it: both dimensions equal the number of pivots. Row rank equals column rank.

The row space is the orthogonal complement of the null space, and the rows of RR make that visible: each row of RR has a 11 in a pivot position and, for each free column, the coefficient that the corresponding special solution must cancel.

The Null Space

The frozen picture below shows the default preset's null space: from RR, the free variable x2x_2 set to 11 gives the special solution (2,1,0)(-2, 1, 0), scaled to (2,1,0)(2, -1, 0), and the product ANAN on the right is the zero vector.

One free column, one basis vector, dimension 11.
R3×3120001000A3×3121243364basis of N(A)3×12−10=03×1000
Null space, frozen

Free variable x₂ = 1 gives (−2, 1, 0), scaled to (2, −1, 0), and A times it is zero. One free column, dimension 3 − 2 = 1.

The special solutions are read from RR one free column at a time. Setting one free variable to 11 and the rest to 00, each pivot row of RR gives one pivot variable directly, with a sign change. Since every solution is determined by its free variables, the special solutions span the null space, and since each has a 11 where the others have 00, they are independent.

Dimension nrn - r is the number of free columns, and it counts the dependencies among the columns of AA: each special solution is a recipe for combining the columns to get zero.

The Left Null Space

The frozen picture below shows the default preset's left null space: ATA^T reduced, its one free variable giving (1,1,1)(1, 1, -1) after scaling, and ATLA^TL equal to the zero vector.

The vector says that row 11 plus row 22 minus row 33 of AA is zero, which is the dependency that made the rank 22.
Aᵀ3×3123246134rref(Aᵀ)3×3101011000basis of N(Aᵀ)3×111−1·03×1000
Left null space, frozen

Aᵀ reduced to [1, 0, 1; 0, 1, 1; 0, 0, 0], one free variable, the vector (1, 1, −1): row 1 plus row 2 minus row 3 of A is zero. Dimension 3 − 2 = 1.

The left null space is the null space of ATA^T, and its vectors y\mathbf{y} satisfy yTA=0\mathbf{y}^TA = \mathbf{0}: they are the combinations of rows that cancel. It can also be read from the row reduction of AA itself, by recording the row operations in the matrix EE with EA=REA = R; the rows of EE that produce the zero rows of RR span the left null space. The tool reduces ATA^T instead because it is the same computation the other three scenes use.

Its dimension mrm - r counts the dependent rows, and it is the space that decides solvability: Ax=bA\mathbf{x} = \mathbf{b} is solvable exactly when b\mathbf{b} is perpendicular to every left-null vector.

The Two Orthogonalities

The frozen picture below shows both checks for the default preset: the rows of AA times the null-space vector, and the column-space basis transposed times the left-null vector, both zero.

Row space and null space are perpendicular in R3\mathbb{R}^3; column space and left null space are perpendicular in R3\mathbb{R}^3 too.
rows of A2×3120001N(A)3×12−10=02×100andC(A)ᵀ2×3123134N(Aᵀ)3×111−1=02×100
Two orthogonalities, frozen

Rows of A times the null vector: zero. Column-space basis transposed times the left-null vector: zero. Each pair of subspaces consists of orthogonal complements.

The two statements are the same statement read twice. Ax=0A\mathbf{x} = \mathbf{0} means each row dotted with x\mathbf{x} is zero, so N(A)C(AT)N(A) \perp C(A^T); apply that to ATA^T and N(AT)C(A)N(A^T) \perp C(A). With the dimensions adding to nn and to mm, each pair consists of orthogonal complements: every vector of the input space splits uniquely into a row-space part and a null-space part, and every vector of the output space into a column-space part and a left-null part.

That splitting is what least squares uses. A right-hand side b\mathbf{b} that is not in the column space has a column-space part, which can be reached, and a left-null part, which cannot; the projection keeps the first and the residual is the second.

When a Null Space Is Trivial

The invertible preset (2113)\begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix} has two pivots and no free columns. The frozen picture below shows its null-space scene: R=IR = I and the null space is {0}\{\mathbf{0}\}.

The same happens for the tall preset, whose two columns are independent, and for the left null space of the wide preset.
R2×21001{0}
A trivial null space, frozen

The invertible preset: R = I, no free columns, null space {0}. The columns are independent and Ax = b has at most one solution.

A trivial null space means the columns are independent and Ax=bA\mathbf{x} = \mathbf{b} never has more than one solution. A trivial left null space means the rows are independent and Ax=bA\mathbf{x} = \mathbf{b} always has at least one. A square matrix with both is invertible, and then the row space and column space are all of Rn\mathbb{R}^n.

The dimension formulas still hold with zeros: r+0=nr + 0 = n says full column rank, r+0=mr + 0 = m full row rank. Both together force m=n=rm = n = r.

Reading the Scene Player

Each scene shows the matrices for one subspace with the reasoning in the caption.

• Pivot positions in RR are accent; free columns are secondary throughout
• Column-space bases are accent, row-space bases primary, null-space bases secondary, left-null bases muted, so the four spaces keep their colours from scene to scene
• In the column-space scene the free columns of AA are greyed, since they are not part of the basis
• In the row-space scene the zero rows of RR are greyed
• Zero matrices in the products ANAN, ATLA^TL and the orthogonality checks are drawn in grey with the target highlight
• Basis vectors are scaled to small integers whenever possible

Choosing a Matrix

The seven presets each make a different point.

3×33 \times 3, rank 22 — the third row is the sum of the first two; every subspace is a line or a plane, and the left-null vector (1,1,1)(1, 1, -1) records the dependency
Rank one(123246)\begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \end{pmatrix}; the null space is a plane in R3\mathbb{R}^3, the left null space the line of (2,1)(2, -1)
Wide 2×32 \times 3 — full row rank; the left null space is {0}\{\mathbf{0}\} and Ax=bA\mathbf{x} = \mathbf{b} is solvable for every b\mathbf{b}
Tall 3×23 \times 2 — full column rank; the null space is {0}\{\mathbf{0}\} and solutions, when they exist, are unique
Invertible — both null spaces trivial, both other spaces the whole plane
4×34 \times 3, rank 22 — two dependent rows and one dependent column; the left null space is a plane in R4\mathbb{R}^4
Zero — rank 00; the null spaces are everything and the column and row spaces are {0}\{\mathbf{0}\}

Shuffle plants a multiple of one row in another most of the time, so the random matrices are usually rank deficient.

What the Four Subspaces Are

An m×nm \times n matrix AA maps Rn\mathbb{R}^n to Rm\mathbb{R}^m, and four subspaces describe the map completely.

In the input space Rn\mathbb{R}^n: the row space C(AT)C(A^T), spanned by the rows of AA, and the null space N(A)N(A), the solutions of Ax=0A\mathbf{x} = \mathbf{0}. In the output space Rm\mathbb{R}^m: the column space C(A)C(A), spanned by the columns, and the left null space N(AT)N(A^T), the solutions of ATy=0A^T\mathbf{y} = \mathbf{0}.

Row reduction to RR finds all four at once. The pivot columns of AA are a basis of the column space; the non-zero rows of RR are a basis of the row space; the special solutions, one per free column, are a basis of the null space; and reducing ATA^T does the same for the left null space. The rank rr, the number of pivots, is the dimension of both the column space and the row space, and the two null spaces have dimensions nrn - r and mrm - r:

dimC(A)+dimN(A)=n,dimC(AT)+dimN(AT)=m\dim C(A) + \dim N(A) = n, \qquad \dim C(A^T) + \dim N(A^T) = m


The second half of the theorem is orthogonality. Ax=0A\mathbf{x} = \mathbf{0} says every row of AA is perpendicular to x\mathbf{x}, so the null space is the orthogonal complement of the row space in Rn\mathbb{R}^n; and ATy=0A^T\mathbf{y} = \mathbf{0} says every column is perpendicular to y\mathbf{y}, so the left null space is the orthogonal complement of the column space in Rm\mathbb{R}^m. The dimensions add up exactly as complements must.

Together: every x\mathbf{x} in Rn\mathbb{R}^n is a row-space part plus a null-space part; AA sends the null-space part to zero and maps the row space one-to-one onto the column space. That is the fundamental theorem of linear algebra. For the theory, see the fundamental subspaces page and the rank page.

Key Properties

Facts about the four subspaces of any m×nm \times n matrix of rank rr.

Dimensions: C(A)C(A) and C(AT)C(A^T) have dimension rr; N(A)N(A) has nrn - r; N(AT)N(A^T) has mrm - r
Row operations preserve the row space and the null space, but change the column space; that is why column-space bases come from AA and row-space bases from RR
Orthogonal complements: N(A)C(AT)N(A) \perp C(A^T) in Rn\mathbb{R}^n and N(AT)C(A)N(A^T) \perp C(A) in Rm\mathbb{R}^m, with dimensions adding to nn and mm
Solvability: Ax=bA\mathbf{x} = \mathbf{b} has a solution exactly when bC(A)\mathbf{b} \in C(A), equivalently when bN(AT)\mathbf{b} \perp N(A^T)
Uniqueness: solutions are unique exactly when N(A)={0}N(A) = \{\mathbf{0}\}, that is r=nr = n
Full row rank r=mr = m: solvable for every b\mathbf{b}; full column rank r=nr = n: at most one solution; both: invertible
The map: AA is one-to-one from C(AT)C(A^T) onto C(A)C(A) and zero on N(A)N(A)
Transpose swaps the pairs: the four subspaces of ATA^T are the same four, with row and column spaces exchanged
Symmetric AA: row space equals column space and the two null spaces coincide

Why It Matters

The four subspaces are the vocabulary for everything about solving and approximating with a matrix.

Solving systems: whether Ax=bA\mathbf{x} = \mathbf{b} has a solution, how many, and the structure of the solution set as a particular solution plus the null space
Least squares: when b\mathbf{b} is not in the column space, the best you can do is project it there; the error lies in the left null space
Rank and dependence: the null space lists the dependencies among the columns, the left null space those among the rows
Networks and circuits: for an incidence matrix, the null space holds potentials, the left null space holds loop currents, and the two conservation laws are the two orthogonality statements
Singular value decomposition: UU and VV contain orthonormal bases of all four subspaces at once
Dimension counting: rank–nullity is the theorem behind every "degrees of freedom" argument in linear models
Understanding a transformation: what it kills, what it reaches, and the one-to-one part in between

Worked Example

Take the default preset,

A=(121243364)A = \begin{pmatrix} 1 & 2 & 1 \\ 2 & 4 & 3 \\ 3 & 6 & 4 \end{pmatrix}


Row reduce. R=(120001000)R = \begin{pmatrix} 1 & 2 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{pmatrix}. Pivots in columns 11 and 33, column 22 free, rank r=2r = 2.

Column space. Basis: columns 11 and 33 of AA, (1,2,3)(1, 2, 3) and (1,3,4)(1, 3, 4). Column 22 is 22 times column 11, as the entry 22 in RR says. Dimension 22, a plane in R3\mathbb{R}^3.

Row space. Basis: (1,2,0)(1, 2, 0) and (0,0,1)(0, 0, 1), the non-zero rows of RR. Dimension 22, a plane in R3\mathbb{R}^3.

Null space. Free variable x2=1x_2 = 1: from RR, x1=2x_1 = -2 and x3=0x_3 = 0, so n=(2,1,0)\mathbf{n} = (-2, 1, 0), or scaled, (2,1,0)(2, -1, 0). Check: A(2,1,0)=(22,44,66)=0A(2, -1, 0) = (2 - 2, 4 - 4, 6 - 6) = \mathbf{0}. Dimension 32=13 - 2 = 1, a line.

Left null space. Reduce AT=(123246134)A^T = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 3 & 4 \end{pmatrix} to (101011000)\begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{pmatrix}; free variable y3=1y_3 = 1 gives l=(1,1,1)\mathbf{l} = (-1, -1, 1), or (1,1,1)(1, 1, -1). Check: row 11 plus row 22 minus row 33 of AA is (0,0,0)(0, 0, 0). Dimension 32=13 - 2 = 1, a line.

Orthogonality. (1,2,0)(2,1,0)=0(1, 2, 0)\cdot(2, -1, 0) = 0 and (0,0,1)(2,1,0)=0(0, 0, 1)\cdot(2, -1, 0) = 0: the row space is perpendicular to the null space. (1,2,3)(1,1,1)=0(1, 2, 3)\cdot(1, 1, -1) = 0 and (1,3,4)(1,1,1)=0(1, 3, 4)\cdot(1, 1, -1) = 0: the column space is perpendicular to the left null space.

Count. 2+1=32 + 1 = 3 in the input space and 2+1=32 + 1 = 3 in the output space. Ax=bA\mathbf{x} = \mathbf{b} is solvable only when b(1,1,1)=0\mathbf{b}\cdot(1, 1, -1) = 0, that is b1+b2=b3b_1 + b_2 = b_3, and then has a line of solutions.

Common Mistakes

A few mistakes recur.

Taking the pivot columns of RR as a column-space basis — row operations change the column space; the basis must be the pivot columns of the original AA
Taking the rows of AA as the reduced basis — they span the row space, but the non-zero rows of RR are the clean basis; using rows of AA risks including a dependent one
Reading the null space from AA rather than RR — the special solutions come from the reduced form, where each pivot variable is expressed in the free ones
Forgetting the left null space — it is the null space of ATA^T, and it needs its own reduction (or the record of row operations)
Miscounting dimensions — the null space has dimension nrn - r and the left null space mrm - r; for a non-square matrix these differ
Confusing "perpendicular to the rows" with "perpendicular to the columns" — the null space is perpendicular to the row space, in Rn\mathbb{R}^n; the left null space to the column space, in Rm\mathbb{R}^m
Assuming a wide matrix has a null space and a tall one does not — it depends on the rank, not the shape, though a wide matrix always has a non-trivial null space and a tall one always has a non-trivial left null space