About the Null Space Calculator
This null space calculator finds a basis for the null space (kernel) of a matrix A — every vector x with Ax = 0 — and writes the general solution in parametric form. It also returns a basis for the column space (the span of A’s pivot columns) and the row space (the non-zero rows of the reduced row echelon form), so all the fundamental subspaces you meet in a linear algebra course come from one input.
Enter the matrix one row per line, with spaces or commas between entries; fractions such as 2/3 and decimals are accepted and every step uses exact rational arithmetic, so there is no rounding. You can keep the textbook form of each basis vector (each free variable set to 1) or scale it to the smallest whole-number vector pointing the same way.
It is meant for students checking homework on kernels, column spaces and the rank–nullity theorem, and for anyone who needs the solution set of a homogeneous system Ax = 0 — for example balancing a chemical equation or finding the dependencies among a set of vectors.
How to use the null space calculator
- 1Enter the matrix with one row per line and entries separated by spaces or commas.
- 2Choose whether to keep the textbook basis (free variables = 1) or scale it to whole numbers.
- 3Read the null space basis and the general solution x = s·v1 + t·v2 + ….
- 4Use the column space and row space bases for questions about span and independence.
- 5Check the RREF to see which variables are pivots and which are free.
Formula and method
The matrix is reduced to reduced row echelon form (RREF) with exact fractions. Columns with a leading 1 are pivot columns; the remaining columns correspond to free variables. Setting one free variable to 1 and the others to 0, and solving each pivot row for its pivot variable (x_pivot = −entry in that free column), gives one basis vector per free variable. Together they span the null space, and they are independent because each has a 1 where the others have 0.
Row operations preserve the row space and the dependencies among columns, so the non-zero RREF rows are a basis for the row space, and the pivot columns of the original matrix A (not of the RREF) are a basis for the column space. The rank–nullity theorem ties these together: rank + nullity = number of columns.
- A
- The m × n matrix you enter
- N(A)
- Null space (kernel): all x with Ax = 0
- C(A)
- Column space: all combinations of A’s columns
- n − rank(A)
- Nullity = number of free variables
Worked examples
3×4 matrix with two free variables
The RREF is [1 2 0 3; 0 0 1 2; 0 0 0 0], so x1 and x3 are pivots and x2, x4 are free. Setting x2 = 1, x4 = 0 gives (−2, 1, 0, 0); setting x2 = 0, x4 = 1 gives x3 = −2 and x1 = −3, so (−3, 0, −2, 1). Columns 1 and 3 of A form the column-space basis.
Kernel of the 1–9 matrix
The RREF is [1 0 −1; 0 1 2; 0 0 0], leaving x3 free. With x3 = 1: x1 = 1 and x2 = −2. Check: 1 − 4 + 3 = 0, 4 − 10 + 6 = 0 and 7 − 16 + 9 = 0, so (1, −2, 1) spans the kernel.
Fractional basis scaled to whole numbers
The RREF is [1 0 −5/2; 0 1 3/2], so the textbook basis vector is (5/2, −3/2, 1). Multiplying by 2 gives the whole-number vector (5, −3, 2): 2·5 + 4·(−3) + 2 = 0 and 5 − 9 + 4 = 0.
Independent columns: trivial kernel
Both columns hold pivots, so there are no free variables. The only solution of Ax = 0 is x = 0 and the null space has dimension 0.
Frequently asked questions
What is the null space of a matrix?+
The null space (or kernel) of A is the set of all vectors x for which Ax = 0. It is always a subspace containing the zero vector, and its dimension — the nullity — equals the number of free variables after row reduction.
How do you find a basis for the null space?+
Row reduce A to RREF, identify the free variables (columns without a pivot), then for each free variable set it to 1 and the others to 0 and solve for the pivot variables. Each resulting vector is one basis vector.
What is the difference between the null space and the column space?+
The null space lives in ℝⁿ (inputs) and holds the vectors A sends to zero; the column space lives in ℝᵐ (outputs) and holds every possible Ax. Their dimensions are n − rank and rank respectively.
Why use pivot columns of the original matrix for the column space?+
Row operations change the column space itself but keep the linear relationships between columns. So the pivot positions found in the RREF tell you which columns of the original A are independent and span its column space.
Is the null space basis unique?+
No. Any set of nullity-many independent vectors in the kernel is a basis, so answers can differ by scaling or combination. This tool gives the standard one from the RREF; scaling to whole numbers is just another valid basis.
What does a trivial null space mean?+
If the null space is only {0}, the columns are linearly independent and the map x ↦ Ax is one-to-one. For a square matrix this means it is invertible.