Column Space Calculator - Basis, Rank, and the RREF
Use this column space calculator to find a basis, the rank, and the reduced row echelon form of any m x n matrix you type in by hand.
Column Space Calculator
Results
What Is a Column Space Calculator?
A column space calculator finds the span of the columns of a matrix, identifies a basis for that span, and reports the rank. It answers, "what subspace of R^m do the columns of A live in, and which of them do I need?" Type the entries of A, and the page reduces A to reduced row echelon form, reads off the pivots, and hands back the rank, the basis column indices, and the RREF.
- • Linear algebra homework and exams: Confirm a problem that asks for a basis of the column space, the rank of a matrix, or the dimension of Col(A) for a 2x2, 3x3, or rectangular matrix.
- • Matrix analysis before solving a linear system: Compute the column space and rank first to check whether Ax = b is consistent, and which columns of A actually contribute to the solution.
- • Computer graphics, robotics, and engineering: Decide which input directions of a Jacobian, stiffness, or transformation matrix actually move the output, and which directions are dead.
If you also need the inverse, the determinant, and the cofactor matrix of a square matrix, the Adjoint Matrix Calculator page runs the same matrix inputs through the cofactor expansion in one pass.
How the Column Space Calculator Works
The page implements the textbook method for a basis of the column space. It reduces A to its reduced row echelon form (RREF), reads off the pivot columns, and returns the original columns of A that sit in those pivot positions.
- A: The m x n input matrix, with real entries from the form.
- a_j: The j-th column of A; a vector in R^m.
- Col(A): The column space of A: the span of the columns a_1, ..., a_n.
- RREF(A): The reduced row echelon form of A; the row-equivalent matrix with pivots equal to 1 and zeros above and below each pivot.
- rank(A): The number of pivot columns in RREF(A), equal to the dimension of Col(A).
The basis the calculator returns is drawn from the original columns of A, not from the RREF. Row operations preserve the row space and the linear-dependence pattern of the columns, not the column space itself, so the pivots in RREF(A) identify the basis columns of A even though the columns of RREF(A) generally live in a different subspace.
Worked example: 3x3 matrix with a dependent column
A = [[1, 2, 2], [3, 6, 6], [0, 1, 1]].
Row reduce A: R2 = R2 - 3*R1, swap R2 and R3, then R1 = R1 - 2*R2. The RREF is [[1, 0, 0], [0, 1, 1], [0, 0, 0]], with pivots in columns 1 and 2.
rank(A) = 2, basis column indices = {1, 2}, dim(Col(A)) = 2.
Column 3 of A equals column 1 plus column 2, so the column space is a 2-dimensional plane in R^3.
According to Wikipedia, the column space of an m x n matrix A is the span of its column vectors in F^m, and a basis for the column space is formed by the columns of A that correspond to the pivot columns of the reduced row echelon form of A.
According to MIT OpenCourseWare 18.06 (Strang), the column space of a matrix A is the subspace spanned by its columns, and a basis for the column space is the set of columns of A whose indices are pivot columns in the reduced row echelon form of A.
If you want to see the same row reduction written out as forward elimination plus back substitution, the Elimination Method Calculator page walks through the steps of solving Ax = b for a 2x2 or 3x3 system.
Key Concepts Behind the Column Space
Four ideas cover the whole pipeline from input matrix to basis of Col(A). They are the same concepts a linear-algebra textbook builds on.
Column space Col(A)
The set of every linear combination of the columns of A, a subspace of R^m whose dimension cannot exceed m or n.
Span of the columns
The span of a set of vectors is the set of every finite linear combination of them. The column space is the span of a_1, ..., a_n.
Basis and linear independence
A basis spans the subspace and contains no redundant members. For the column space, the basis is the set of original columns of A whose indices are pivot columns in RREF(A).
Rank and dimension
The rank of A is the dimension of Col(A), which is also the number of pivots in RREF(A). When rank = n the columns are linearly independent, and when rank = m the columns span R^m.
These four ideas cover every question a textbook problem asks about the column space. The rank-nullity theorem ties Col(A) to the null space: dim(Col(A)) + dim(Null(A)) = n, so the rank gives the nullity of A for free.
Once you have a basis of column vectors, the Vector Magnitude Calculator page returns the magnitude of any one of them so you can see how long each basis vector is.
How to Use This Column Space Calculator
Five short steps cover every common case, from a clean 3x3 textbook example to a tall 4x2 rectangular matrix.
- 1 Pick the matrix size: Choose the number of rows m (2, 3, or 4) and the number of columns n (2, 3, or 4). The matching entry grid appears below.
- 2 Enter the matrix entries: Type the values of A into the grid. Real numbers, decimals, and negative entries are all fine; the calculator does not require any preprocessing.
- 3 Read the rank: The primary output is the rank of A, which is the dimension of the column space. It updates on every keystroke, so you do not need a separate Solve button.
- 4 Read the basis column indices: The basis column indices line lists the 1-based positions of the original columns of A that span Col(A). Zero matrix gives 'None' and a full-column-rank matrix gives 1, 2, ..., n.
- 5 Use Reset to start over: Reset restores the default 3x3 example so you can see the result without typing. The size selector jumps straight to a new shape without reloading the page.
Try a 3x3 matrix A = [[1, 2, 2], [3, 6, 6], [0, 1, 1]]. The calculator returns rank 2 and basis columns {1, 2}; column 3 is the sum of columns 1 and 2 and carries no new direction.
If the matrix came from a linear system and you actually want the solution to Ax = b, the System of Equations Calculator page solves the system by Cramer's rule and shows the augmented matrix.
Benefits of Using This Column Space Calculator
These benefits matter most when you are working a problem by hand and need a fast, trustworthy check on a column-space question.
- • Skip the algebra mistakes: Manual RREF calculations are easy to get wrong on the scaling step. The calculator handles the row swaps, the scaling, and the elimination so you can focus on the question.
- • See the basis in 1-based form: The basis column indices are returned as 1-based column numbers, so you can match them straight back to the columns of A without an off-by-one error.
- • Get the rank for free: The rank of A is the dimension of Col(A), so the same calculation gives you the column space answer and the rank answer. The result panel shows both, plus a dim(Col(A)) reminder.
- • Handle any real m x n matrix up to 4x4: Square, wide, and tall matrices all use the same RREF algorithm. Negative and decimal entries are fine, and the page does not require you to pre-process the numbers.
- • Connect to the rest of linear algebra: If your next step is solving Ax = b, computing the null space, or asking whether a vector is in Col(A), the page links out to the relevant peer calculator in the same category.
The page is most useful as a check, not as a replacement for understanding the algorithm. Use it to confirm a homework answer, sanity-check a column-space claim, or pre-validate a matrix before you feed it to a longer script.
If you want to check whether two of the column vectors you got are orthogonal before you call them a basis, the Dot Product Calculator page returns the dot product of two vectors in one step.
Factors That Affect the Column Space Result
The algorithm is the same in every case, but a few factors change how the result should be read and how the basis is chosen.
Linear dependence between columns
When two or more columns of A are scalar multiples or linear combinations of each other, the RREF collapses the redundant columns to zero rows. The rank drops, and the basis drops the redundant columns.
Matrix shape (m vs n)
A wide matrix (n > m) has rank at most m; a tall matrix (m > n) has rank at most n. The basis never has more than min(m, n) vectors.
Numerical precision of the entries
Entries that are nearly equal (or nearly zero) can change the pivot pattern at the fourth decimal place. The calculator uses a 1e-9 tolerance for pivot detection.
Zero matrix
When every entry is zero, the column space is the trivial subspace {0}, the rank is 0, and there is no basis. The page returns a 'None (zero matrix)' message.
- • The page is limited to real matrices up to 4x4. The RREF algorithm extends without change, but the form and result panel would need a different layout for larger matrices.
- • The basis is drawn from the original columns of A, not from a normalized or orthogonalized set. If you need an orthonormal basis, the page is a starting point and the next step is Gram-Schmidt.
- • Pivot detection uses a 1e-9 tolerance. Entries that are exactly zero at the symbolic level but compute to a tiny nonzero number due to rounding can change the pivot count; enter exact values where possible.
According to Wolfram MathWorld, the column space of a matrix A is the subspace of F^m spanned by the column vectors of A, and the dimension of the column space is the rank of A by the rank-nullity theorem.
When the basis is one-dimensional and the next move is to back-substitute a single pivot into a 2x2 or 3x3 system, the Substitution Method Calculator page walks the substitution step that the elimination leaves behind.
Frequently Asked Questions
Q: What is the column space of a matrix?
A: The column space of a matrix A is the span of its column vectors. It is a subspace of R^m that contains every vector that can be written as a linear combination of the columns of A.
Q: How do I find a basis for the column space of a matrix?
A: Reduce A to its reduced row echelon form. The columns of A that line up with the pivot columns of the RREF form a basis for the column space. The dimension of the column space is the rank, which equals the number of pivots.
Q: What is the relationship between column space and the rank of a matrix?
A: The rank of A is the dimension of the column space. Equivalently, it is the number of linearly independent columns in A, which is also the number of pivots in the RREF.
Q: How is the column space different from the null space?
A: The column space is a subspace of R^m spanned by the columns of A, while the null space is a subspace of R^n made up of the vectors x with Ax = 0. The rank-nullity theorem says their dimensions add up to n.
Q: Can the column space of a non-square matrix be computed?
A: Yes. The column space is defined for any m x n matrix and lives in R^m. A wide matrix (n > m) has rank at most m, and a tall matrix (m > n) has rank at most n, but in both cases the column space and a basis are well defined.
Q: What does the column space look like for a zero matrix?
A: The column space of the zero matrix is the trivial subspace {0}. The rank is 0, and there is no basis in the usual sense; the calculator returns a 'None (zero matrix)' message.