Matrix Rank Calculator
Find the rank and nullity of any matrix with exact fractions, get a basis for all four fundamental subspaces, and see what the matrix collapses.
Matrix
Enter a matrix of any shape, or start from an example.
Up to 12 rows and 12 columns.
Use integers, decimals, or fractions such as 1/3. Paste rows from a spreadsheet or a Python list into any cell.
Input
Rank and subspaces
Updates as you type.
- Rank
- 2
- Nullity
- 2
Rank + nullity = 2 + 2 = 4, the number of columns.
Column spaceDimension 2
Every output the matrix can produce. Basis: the pivot columns of A, not of the RREF.
Row spaceDimension 2
Every combination of the rows. Basis: the nonzero rows of the RREF.
Null spaceDimension 2
Every input the matrix sends to zero, the solutions of Ax = 0. Basis: one vector per free column.
Left null spaceDimension 1
The combinations of rows that cancel to zero, the solutions of yᵀA = 0. Basis: the null space of Aᵀ.
Work it out
Row operations don't change the rank, so reduce the matrix and count the pivots.
Show all 3 row operations
Building the null space
Each free column gives one basis vector. Set that free variable to 1 and the others to 0, then read each pivot variable from its row of the RREF.
Free column 2, so = 1:
Free column 4, so = 1:
What rank means
The rank of a matrix is the number of independent directions it preserves. It has several equivalent descriptions:
- The number of pivots after row reduction.
- The dimension of the column space, the set of all outputs .
- The dimension of the row space.
That the last two always match is a surprising fact: a matrix has exactly as many independent rows as independent columns, whatever its shape.
The four fundamental subspaces
An matrix of rank comes with four subspaces:
| Subspace | What it holds | Dimension |
|---|---|---|
| Column space | All outputs | |
| Row space | All combinations of the rows | |
| Null space | All with | |
| Left null space | All with |
The dimensions in the first and third rows give the rank-nullity theorem:
Every input dimension either survives into the output or is lost to zero.
Tips for using the calculator
- A basis for the column space uses the pivot columns of the original matrix. Row operations change the column space, so the columns of the RREF generally aren't in it.
- Open Steps to see how each free variable produces one null space vector.
- Open See with a matrix to watch the image and the null space trade places as the rank changes.
- Decimals are shown rounded, but the rank is computed exactly, so a tiny value such as still counts as nonzero. That differs from numerical tools, which treat very small values as .
The row reduction itself is explained in the RREF Calculator. A square matrix of full rank has an inverse, which you can find in the Matrix Inverse Calculator, and a nonzero value in the Determinant Calculator.
Related calculators
Keep working with matrices.
SVD Calculator
Find the singular value decomposition UΣVᵀ of any matrix up to 6×6, with rank and condition number. Watch a circle turn, stretch into an ellipse, and turn again.
Linear Independence and Span Calculator
Check whether vectors are linearly independent, with exact dependency relations like v₃ = 2v₁ − v₂. Find a basis for the span, and watch it grow from a line to a plane to space.
RREF Calculator
Row reduce any matrix with exact fractions, step through every row operation, and practice Gaussian elimination.
Determinant Calculator
Find the determinant of a square matrix with exact fractions, drag a live area picture, and step through elimination or cofactor expansion.