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.
Column space C(A) — all combinations of the columns of A; the set of b for which Ax=b is solvable. A subspace of Rm of dimension r.
Null space N(A) — all solutions of Ax=0. A subspace of Rn of dimension n−r.
Row space C(AT) — all combinations of the rows of A. A subspace of Rn of dimension r.
Left null space N(AT) — all solutions of ATy=0, equivalently yTA=0. A subspace of Rm of dimension m−r.
Rank r — the number of pivots of A; the common dimension of the column and row spaces.
Pivot columns — the columns of A (not of R) at pivot positions; a basis of the column space.
Special solutions — one null-space vector per free column, with that free variable 1 and the others 0.
Rank–nullity — r+dimN(A)=n; applied to AT, r+dimN(AT)=m.
Orthogonal complement — N(A)=C(AT)⊥ in Rn and N(AT)=C(A)⊥ in Rm.
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×3 of rank 2 with every subspace non-trivial, a rank-one matrix, wide and tall matrices of full rank, an invertible matrix, a 4×3 of rank 2, and the zero matrix • Use the two Size steppers for any shape from 2×2 to 4×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 reduce — A→R with the pivots and free columns marked; the rank r is the number of pivots • Column space — the pivot columns of the original A, with each free column expressed as a combination of them using the entries of R • Row space — the non-zero rows of R • Null space — one special solution per free column, scaled to integers, with AN=0 shown as a matrix product • Left null space — AT row reduced and its special solutions read off, with ATL=0 shown • Orthogonality — the rows of A 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=b
When a null space is trivial the scene says so and shows {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 R with two pivots, in columns 1 and 3, and column 2 free.
The rank 2 is now known, and with it the dimensions of all four subspaces: 2, 1, 2, 1.
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=EA for an invertible E. Two things follow. The row space is unchanged, since the rows of R are combinations of the rows of A and vice versa. And the null space is unchanged, since Ax=0 and EAx=0 have the same solutions.
The column space is changed, in general, but the dependencies among the columns are not: Ax=0 and Rx=0 are the same statement. So the columns of A at the pivot positions of R are independent, and every other column of A depends on them by the same coefficients that appear in R.
The Column Space
The frozen picture below shows the column-space basis of the default preset: the pivot columns of A, (1,2,3) and (1,3,4), with the free column greyed.
The free column is 2 times the first pivot column, and the number 2 is read straight from R.
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 Ax, so it is exactly the set of right-hand sides b for which Ax=b can be solved. For this matrix it is a plane in R3, and a system with a b off that plane has no solution.
Because Ax is the combination of the columns with coefficients x1,…,xn, 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 R, (1,2,0) and (0,0,1), with the zero row greyed.
The rows of A span the same plane; R just presents it in its simplest basis.
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 and the other in Rm, 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 R make that visible: each row of R has a 1 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 R, the free variable x2 set to 1 gives the special solution (−2,1,0), scaled to (2,−1,0), and the product AN on the right is the zero vector.
One free column, one basis vector, dimension 1.
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 R one free column at a time. Setting one free variable to 1 and the rest to 0, each pivot row of R 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 1 where the others have 0, they are independent.
Dimension n−r is the number of free columns, and it counts the dependencies among the columns of A: 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: AT reduced, its one free variable giving (1,1,−1) after scaling, and ATL equal to the zero vector.
The vector says that row 1 plus row 2 minus row 3 of A is zero, which is the dependency that made the rank 2.
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 AT, and its vectors y satisfy yTA=0: they are the combinations of rows that cancel. It can also be read from the row reduction of A itself, by recording the row operations in the matrix E with EA=R; the rows of E that produce the zero rows of R span the left null space. The tool reduces AT instead because it is the same computation the other three scenes use.
Its dimension m−r counts the dependent rows, and it is the space that decides solvability: Ax=b is solvable exactly when 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 A 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; column space and left null space are perpendicular in R3 too.
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=0 means each row dotted with x is zero, so N(A)⊥C(AT); apply that to AT and N(AT)⊥C(A). With the dimensions adding to n and to m, 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 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) has two pivots and no free columns. The frozen picture below shows its null-space scene: R=I and the null space is {0}.
The same happens for the tall preset, whose two columns are independent, and for the left null space of the wide preset.
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=b never has more than one solution. A trivial left null space means the rows are independent and Ax=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.
The dimension formulas still hold with zeros: r+0=n says full column rank, r+0=m full row rank. Both together force m=n=r.
Reading the Scene Player
Each scene shows the matrices for one subspace with the reasoning in the caption.
• Pivot positions in R 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 A are greyed, since they are not part of the basis • In the row-space scene the zero rows of R are greyed • Zero matrices in the products AN, ATL 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×3, rank 2 — 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) records the dependency • Rank one — (122436); the null space is a plane in R3, the left null space the line of (2,−1) • Wide 2×3 — full row rank; the left null space is {0} and Ax=b is solvable for every b • Tall 3×2 — full column rank; the null space is {0} and solutions, when they exist, are unique • Invertible — both null spaces trivial, both other spaces the whole plane • 4×3, rank 2 — two dependent rows and one dependent column; the left null space is a plane in R4 • Zero — rank 0; the null spaces are everything and the column and row spaces are {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×n matrix A maps Rn to Rm, and four subspaces describe the map completely.
In the input space Rn: the row spaceC(AT), spanned by the rows of A, and the null spaceN(A), the solutions of Ax=0. In the output space Rm: the column spaceC(A), spanned by the columns, and the left null spaceN(AT), the solutions of ATy=0.
Row reduction to R finds all four at once. The pivot columns of A are a basis of the column space; the non-zero rows of R are a basis of the row space; the special solutions, one per free column, are a basis of the null space; and reducing AT does the same for the left null space. The rank r, the number of pivots, is the dimension of both the column space and the row space, and the two null spaces have dimensions n−r and m−r:
dimC(A)+dimN(A)=n,dimC(AT)+dimN(AT)=m
The second half of the theorem is orthogonality. Ax=0 says every row of A is perpendicular to x, so the null space is the orthogonal complement of the row space in Rn; and ATy=0 says every column is perpendicular to y, so the left null space is the orthogonal complement of the column space in Rm. The dimensions add up exactly as complements must.
Together: every x in Rn is a row-space part plus a null-space part; A 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×n matrix of rank r.
• Dimensions: C(A) and C(AT) have dimension r; N(A) has n−r; N(AT) has m−r • Row operations preserve the row space and the null space, but change the column space; that is why column-space bases come from A and row-space bases from R • Orthogonal complements: N(A)⊥C(AT) in Rn and N(AT)⊥C(A) in Rm, with dimensions adding to n and m • Solvability: Ax=b has a solution exactly when b∈C(A), equivalently when b⊥N(AT) • Uniqueness: solutions are unique exactly when N(A)={0}, that is r=n • Full row rankr=m: solvable for every b; full column rankr=n: at most one solution; both: invertible • The map: A is one-to-one from C(AT) onto C(A) and zero on N(A) • Transpose swaps the pairs: the four subspaces of AT are the same four, with row and column spaces exchanged • Symmetric A: 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=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 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: U and V 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=123246134
Row reduce.R=100200010. Pivots in columns 1 and 3, column 2 free, rank r=2.
Column space. Basis: columns 1 and 3 of A, (1,2,3) and (1,3,4). Column 2 is 2 times column 1, as the entry 2 in R says. Dimension 2, a plane in R3.
Row space. Basis: (1,2,0) and (0,0,1), the non-zero rows of R. Dimension 2, a plane in R3.
Null space. Free variable x2=1: from R, x1=−2 and x3=0, so n=(−2,1,0), or scaled, (2,−1,0). Check: A(2,−1,0)=(2−2,4−4,6−6)=0. Dimension 3−2=1, a line.
Left null space. Reduce AT=121243364 to 100010110; free variable y3=1 gives l=(−1,−1,1), or (1,1,−1). Check: row 1 plus row 2 minus row 3 of A is (0,0,0). Dimension 3−2=1, a line.
Orthogonality.(1,2,0)⋅(2,−1,0)=0 and (0,0,1)⋅(2,−1,0)=0: the row space is perpendicular to the null space. (1,2,3)⋅(1,1,−1)=0 and (1,3,4)⋅(1,1,−1)=0: the column space is perpendicular to the left null space.
Count.2+1=3 in the input space and 2+1=3 in the output space. Ax=b is solvable only when b⋅(1,1,−1)=0, that is b1+b2=b3, and then has a line of solutions.
Common Mistakes
A few mistakes recur.
• Taking the pivot columns of R as a column-space basis — row operations change the column space; the basis must be the pivot columns of the original A • Taking the rows of A as the reduced basis — they span the row space, but the non-zero rows of R are the clean basis; using rows of A risks including a dependent one • Reading the null space from A rather than R — 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 AT, and it needs its own reduction (or the record of row operations) • Miscounting dimensions — the null space has dimension n−r and the left null space m−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; the left null space to the column space, in Rm • 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
Related Concepts
Matrix rank — the number r that fixes all four dimensions; the rank tool shows the elimination that finds it.
Linear system solutions — solvability is membership of b in the column space, and the solution set is a shift of the null space.
Span and linear independence — the column space is a span, and the null space is the record of the dependencies.
Basis and dimension — each subspace scene produces a basis, and rank–nullity is the dimension count.