Null Space Calculator
Enter a matrix of up to 4 rows and 4 columns to find its null space (kernel), nullity, and rank. The calculator runs Gauss-Jordan elimination to reduced row echelon form (RREF), identifies the free variables, and expresses the null space as a set of linearly independent basis vectors with a parametric solution. Results update as you type.
Formula
Worked example
For A = [[1,2,3],[4,5,6],[7,8,9]] (3x3): RREF gives [[1,0,-1],[0,1,2],[0,0,0]]. Rank = 2, nullity = 1. Free variable x3 = t; back-substitution gives x1 = t, x2 = -2t. Null space basis: {[1, -2, 1]}.
What is the null space of a matrix?
The null space (also called the kernel) of a matrix A is the set of all vectors x that satisfy the homogeneous equation A x = 0. In other words, multiplying A by any vector in the null space produces the zero vector. The null space is always a subspace of R^n (where n is the number of columns), because it is closed under addition and scalar multiplication and always contains the zero vector.
How this calculator finds the null space
The calculator performs Gauss-Jordan elimination on the matrix A to produce its reduced row echelon form (RREF). The RREF has the same null space as the original matrix, but it is much easier to read: columns with leading 1s (pivot columns) correspond to dependent variables, while the remaining columns correspond to free variables. For each free variable, the calculator introduces a parameter (t, s, u, ...) and back-substitutes using the pivot rows to express every pivot variable in terms of the free parameters. The resulting column vectors, one per free variable, form the basis of the null space.
The rank-nullity theorem
The rank-nullity theorem states that for any matrix A with n columns: rank(A) + nullity(A) = n. The rank is the number of pivot columns (the dimension of the column space), and the nullity is the number of free columns (the dimension of the null space). This means that if you know one, you can find the other by subtraction. For example, a 3x4 matrix with rank 2 must have nullity 2. A matrix with full column rank (nullity = 0) has a trivial null space containing only the zero vector; the equation A x = 0 has a unique solution.
Reading the results and next steps
The nullity tells you the dimension of the null space. A nullity of 0 means the only solution to A x = 0 is x = 0 (the columns are linearly independent). A nullity of 1 means the null space is a line through the origin in R^n. A nullity of 2 means it is a plane, and so on. For solving a non-homogeneous system A x = b, first find one particular solution x_p (if it exists), then add any vector from the null space: the complete solution is x = x_p + t * v1 + s * v2 + ... where v1, v2, ... are the null space basis vectors.
Null space properties by matrix type
| Scenario | Rank | Nullity | Null space |
|---|---|---|---|
| Full column rank (rank = n) | n | 0 | Trivial: only {0} |
| Square invertible matrix | n = m | 0 | Trivial: only {0} |
| One linearly dependent column | n - 1 | 1 | 1D (a line through the origin) |
| k linearly dependent columns | n - k | k | k-dimensional subspace |
| Zero matrix (all entries = 0) | 0 | n | All of R^n |
| Row of zeros present | < m | >= 1 | At least 1D |
Quick reference for common scenarios. n = number of columns, m = number of rows.
Frequently asked questions
What is the null space of a matrix?
The null space (or kernel) of a matrix A is the set of all vectors x such that A x = 0. It is always a subspace containing at least the zero vector. If the null space contains only the zero vector, it is called trivial.
What is nullity?
Nullity is the dimension of the null space, which equals the number of free variables in the system A x = 0. It is also the number of basis vectors that span the null space. By the rank-nullity theorem, nullity = (number of columns) - rank.
What is the rank-nullity theorem?
For any matrix A with n columns, rank(A) + nullity(A) = n. The rank counts the pivot columns (independent directions in the column space) and the nullity counts the free columns (dimensions of the kernel). Together they always add up to the total number of columns.
What does it mean if the nullity is 0?
A nullity of 0 means the null space is trivial: the only solution to A x = 0 is x = 0. This happens when all columns of A are linearly independent. For a square matrix this also means the matrix is invertible.
How do I enter a matrix into this calculator?
Choose the number of rows and columns with the dropdowns, then type the matrix entries left-to-right, row by row, separated by spaces or commas. For example, a 2x3 matrix with rows [1, 2, 3] and [4, 5, 6] is entered as: 1 2 3 4 5 6. The RREF and basis vectors update automatically.
What is the difference between the null space and the column space?
The column space (image or range) of A is the set of all vectors that can be expressed as A x for some x, and it has dimension equal to the rank. The null space is the set of all x with A x = 0, and it has dimension equal to the nullity. The rank-nullity theorem links the two: rank + nullity = number of columns.
Can the null space contain more than one vector?
Yes. The null space always contains the zero vector. If the nullity is 1 or more, it contains infinitely many vectors: every scalar multiple of a basis vector is in the null space, as are all their linear combinations. Only a trivial null space (nullity = 0) is limited to just {0}.