Column Space Calculator
Enter your matrix, choose its size (up to 4 rows by 4 columns), and this calculator finds the column space of the matrix: the basis vectors that span it, the rank (number of basis vectors), and the dimension. A full Gaussian elimination walkthrough shows every row operation so you can follow along and check your work.
Formula
Worked example
For A = [[1,2,1],[0,1,3],[2,5,0]], reduce to RREF to get [[1,0,-5],[0,1,3],[0,0,0]]. The pivot columns are columns 1 and 2, so a basis for Col A is {[1,0,2], [2,1,5]} (from the original A). The rank is 2 and the nullity is 3 - 2 = 1.
What is the column space of a matrix?
The column space of a matrix A, written Col A, is the set of all linear combinations of the columns of A. More precisely, if A has columns a1, a2, ..., an, then Col A = {c1*a1 + c2*a2 + ... + cn*an : c1, ..., cn are real numbers}. Geometrically, the column space is the subspace of R^m (where m is the number of rows) that the matrix can "reach" - it is exactly the set of all vectors b for which Ax = b has at least one solution. The dimension of the column space is called the rank of the matrix.
How to find the column space - the RREF method
The standard approach is to reduce the matrix to reduced row echelon form (RREF) using Gauss-Jordan elimination. You then identify the columns in the RREF that contain the leading 1s (pivot positions). Critically, the basis for Col A is formed by the corresponding columns of the ORIGINAL matrix A, not the RREF. This is because elementary row operations preserve linear dependence relations among the columns but change the column vectors themselves. Once you have the pivot column indices, grab those columns from A - they are a basis for Col A. The number of pivot columns equals the rank; the number of non-pivot columns (free variables) equals the nullity.
The Rank-Nullity Theorem and the four fundamental subspaces
Every m x n matrix A has four fundamental subspaces: the column space Col A (dimension = rank r) and the left null space Null A^T (dimension m - r) in R^m, and the row space Row A (dimension r) and the null space Null A (dimension n - r) in R^n. The Rank-Nullity Theorem states rank(A) + nullity(A) = n, where n is the number of columns. This means if you know the rank you immediately know the nullity, and vice versa. The row space and column space always have the same dimension (the rank), even though they live in different spaces. These four subspaces are pairwise orthogonal in a precise sense: the null space is the orthogonal complement of the row space inside R^n, and the left null space is the orthogonal complement of the column space inside R^m.
Practical interpretation: when is Ax = b solvable?
The system Ax = b is consistent (has at least one solution) if and only if b lies in the column space of A. If the matrix has full row rank (rank = m), then Col A = R^m and the system is consistent for every right-hand side b. If rank < m, there are vectors b outside Col A for which no solution exists. When the system is consistent, it has exactly one solution if and only if the null space is trivial (nullity = 0, i.e., rank = n), and infinitely many solutions otherwise. This makes the column space central to understanding existence and uniqueness of solutions to linear systems.
Key subspace properties by rank
| Subspace | Notation | Dimension | Lives in |
|---|---|---|---|
| Column space | Col A | r (rank) | R^m |
| Row space | Row A | r (rank) | R^n |
| Null space (kernel) | Null A | n - r (nullity) | R^n |
| Left null space | Null A^T | m - r | R^m |
For an m x n matrix A with rank r, the fundamental subspaces have these dimensions (by the Rank-Nullity Theorem).
Frequently asked questions
What is the difference between the column space and the row space?
The column space (Col A) is spanned by the columns of A and lives in R^m (same dimension as the number of rows). The row space (Row A) is spanned by the rows of A and lives in R^n (same dimension as the number of columns). Despite living in different ambient spaces, both have the same dimension - the rank of A. You can find the row space by applying RREF and reading off the non-zero rows, whereas the column space basis comes from the pivot columns of the original matrix.
Why do I use the original matrix columns and not the RREF columns as the basis?
Row operations change the column vectors but preserve which columns are linearly dependent on which others (the linear dependence relations are unchanged). The RREF pivot columns correctly identify WHICH columns form a basis, but the actual vectors in R^m that should be used are the ones from the original matrix A. If you use RREF columns, you get a different subspace (actually equal to R^r, the standard basis), not the true column space of A.
What does it mean when the column space equals R^m?
When Col A = R^m, the matrix has full row rank (rank = m). This means every vector b in R^m can be written as a linear combination of the columns of A. Equivalently, the system Ax = b has at least one solution for every possible right-hand side b. This situation requires the matrix to have at least as many columns as rows (n >= m) and the columns to span the whole space.
How is the column space related to the null space?
The null space (Null A) is the set of vectors x such that Ax = 0. While the null space and column space live in different spaces (R^n and R^m respectively), they are linked by the Rank-Nullity Theorem: dim(Col A) + dim(Null A) = n. Increasing the rank by 1 decreases the nullity by 1. The null space is the orthogonal complement of the row space in R^n, not directly of the column space.
Can the column space be the same as the null space?
Only when A is a square matrix and its column space and null space happen to coincide - a rare and special condition. A simple example is the 2x2 matrix [[0,1],[0,0]], whose column space is spanned by [1,0] and whose null space is spanned by [1,0] as well. Such matrices A satisfy A^2 = 0 and are called nilpotent. In general the column space is in R^m and the null space is in R^n, so they live in different spaces and cannot literally be the same set unless m = n.