What this calculator does
The null space of a matrix is every vector the matrix sends to zero. For the matrix with rows 1 2 3, 2 4 6 and 1 1 1, the null space is one-dimensional and spanned by (1, −2, 1).
Rank and nullity always add to the number of columns, which is the rank-nullity theorem and the quickest sanity check on any answer. A 3-column matrix of rank 2 must have nullity 1, so if you find two independent null vectors you have made an arithmetic slip somewhere.
The formula
The matrix is reduced to row-echelon form by Gaussian elimination with partial pivoting. The number of pivot columns is the rank, and every column without a pivot corresponds to a free variable. Setting one free variable to 1 and the rest to 0, then reading the pivot rows back, produces one basis vector per free column.
| Term | Meaning |
|---|---|
| Null space | Every vector x satisfying Ax = 0. Also called the kernel. |
| Nullity | The dimension of the null space: how many independent vectors span it. |
| Rank | The number of independent rows or columns, equal to the pivot count. |
| Rank-nullity theorem | Rank plus nullity equals the number of columns, always. |
The inputs explained
| Field | What to enter |
|---|---|
| Matrix size | Matrix size. The row entry is read to match, so extra values are ignored and short rows are padded with zeros. |
| Matrix rows, one per line (comma separated) | One row per semicolon, values within a row separated by commas. For example 1, 2, 3; 2, 4, 6; 1, 1, 1. |
When to use it
Solving a homogeneous system
The null space is exactly the solution set of Ax = 0, so a basis for it describes every solution.
Testing whether a matrix is invertible
A square matrix is invertible precisely when its null space contains only the zero vector.
Checking linear independence
A non-trivial null space means the columns are linearly dependent, and the basis vector shows the dependency.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
What null space do these matrices have?
Three matrices with different amounts of linear dependence.
| Matrix rows | Nullity (dimension of the null space) | Rank | Null space basis |
|---|---|---|---|
| 1, 0, 0; 0, 1, 0; 0, 0, 1 | 0 | 3 of 3 | only the zero vector — the matrix is invertible |
| 1, 2, 3; 2, 4, 6; 1, 1, 1 | 1 | 2 of 3 | (1.00, -2.00, 1.00) |
| 1, 2, 3; 2, 4, 6; 3, 6, 9 | 2 | 1 of 3 | (-2.00, 1.00, 0.00) (-3.00, 0.00, 1.00) |
Questions
What does the null space tell me?
Which combinations of the columns cancel out to zero. A non-trivial null space means the columns are linearly dependent, the matrix is singular, and any system Ax = b either has no solution or infinitely many rather than exactly one.
What is the rank-nullity theorem?
Rank plus nullity equals the number of columns. It holds for every matrix without exception, which makes it the fastest check on a computed answer: if your rank and nullity do not sum to the column count, one of them is wrong.
Why is the basis not unique?
Because any set of independent vectors spanning the same space is a valid basis. Scaling a basis vector, or adding one to another, gives an equally correct answer. The convention here sets each free variable to 1 in turn, which produces one standard choice.
What does nullity zero mean?
That only the zero vector maps to zero, so the matrix is full rank and invertible. For a square matrix this is equivalent to a non-zero determinant, and to the columns being linearly independent.
For inverting a matrix, see the matrix inverse calculator. For the determinant, see the matrix determinant calculator.