Column Space Calculator
Welcome to the column space calculator, where we'll study how to determine the column space of a matrix. The whole process is quite similar to how we calculate the rank of a matrix, but if you're new to the topic, don't worry! We'll slowly go through all the theory and provide you with some examples. And we will not only find the column space — we'll give you the basis for the column space as well!
What is a matrix?
A matrix is an array of elements (usually numbers) that has a set number of rows and columns. An example of a matrix would be:
A = ⎡ 3 -1 ⎤
⎢ 0 2 ⎥
⎣ 1 -1 ⎦
We say that a matrix has cells, or boxes, into which we write the elements of our array. For example, matrix A above has the value 2 in the cell that is in the second row and the second column. The starting point here is the 1-cell matrix, which is, for all intents and purposes, the same thing as a real number.
Matrices appear naturally when dealing with:
- Systems of equations, especially with Cramer's rule;
- Vectors and vector spaces;
- 3-dimensional geometry (e.g., the dot product and the cross product);
- Linear transformations (translation and rotation); and
- Graph theory and discrete mathematics.
Column space of a matrix
Every m×n matrix A can be viewed as a list of n column vectors, each living in ℝm (they have m entries). The column space of A, written Col(A), is the set of all linear combinations of those columns:
Col(A) = span{ c₁, c₂, …, cₙ } ⊆ ℝm
It is a subspace of ℝm: it always contains the zero vector, and it is closed under addition and scalar multiplication. If you think of A as the matrix of a linear transformation x → Ax, then the column space is exactly the image (range) of that transformation — the set of every vector you can reach as an output.
The dimension of the column space equals the rank of the matrix. When the rank equals the number of rows m, the columns span the whole of ℝm; otherwise Col(A) is a proper subspace — a line or a plane through the origin, for example.
Basis for the column space
A basis for the column space is a smallest set of columns that still spans Col(A). The key fact is:
The pivot columns of A form a basis for the column space — but you take the columns from the original matrix A, not from its row echelon form.
So the recipe is: row-reduce A to spot which columns hold pivots, then go back and grab those same columns from the original matrix. The number of pivot columns is the rank, i.e. the dimension of Col(A). The remaining (non-pivot) columns are linear combinations of the pivot columns, so they add nothing new to the span.
Example: using the column space calculator
Consider the 3×3 matrix loaded by default:
1 2 3 4 5 6 7 8 10
Enter your own numbers into the grid on the left, choose the size of your matrix (from 2×2 up to 5×5), and press Calculate column space. The calculator instantly returns:
- the dimension of the column space and whether the columns span all of ℝm;
- the row echelon form with the pivot columns highlighted;
- a basis for the column space, listed as column vectors taken from the original matrix;
- the nullity and a rank–nullity summary.
Example: how to calculate column space of a matrix by hand?
Let's do the default matrix step by step. Reduce A to row echelon form by Gaussian elimination:
- Use the top-left entry as the first pivot and eliminate the entries below it in column 1.
- Create a pivot in column 2 with the remaining rows and eliminate below it.
- Column 3 also ends up with a pivot, so all three columns are pivot columns.
Since columns 1, 2 and 3 are all pivot columns, the basis for the column space is simply those three original columns:
Col(A) = span{ (1, 4, 7), (2, 5, 8), (3, 6, 10) }
Here the rank is 3 = m, so the three columns are linearly independent and span the entire ℝ3. If instead the third column had been, say, the sum of the first two, only columns 1 and 2 would be pivots, the dimension would drop to 2, and Col(A) would be a plane through the origin.
You can work with pure abstract numbers, or attach a metric, US customary, or currency context (12 world currencies including the US dollar and the Russian ruble) when your matrix entries represent real-world quantities.