Skip to content

Null Space Calculator — Step-by-Step Solutions

The Null Space Calculator finds the null space (kernel) of a matrix by reducing it to reduced row echelon form using Gaussian elimination. It computes the null space basis vectors, nullity, and column space.

Enter a matrix of any size up to 5x5, and the calculator will identify pivot and free variables, compute basis vectors for the null space, and verify the rank-nullity theorem.

Your calculations will appear here

How to Use the Null Space Calculator

  1. Set the number of rows and columns of your matrix (2 to 5 of each), then type the entries into the grid. Null-space vectors have one entry per column, so a matrix with 4 columns has null-space vectors with 4 entries.
  2. Choose a mode: Null Space Basis lists a set of vectors that span the null space, Nullity gives only its dimension, RREF with Free Variables shows the reduced matrix with pivot and free columns, and Column Space lists a basis for the column space.
  3. Read the result and the row-reduction steps below it. The rank and the nullity are always shown together so you can check rank + nullity = number of columns.
  4. To check an answer, multiply the matrix by each basis vector. Every product should be the zero vector.

Formula and Theory

The null space (kernel) of a matrix A is the set of all vectors x with Ax = 0. It always contains the zero vector, and it is closed under addition and scaling, so it is a subspace. Solving for it is the same task as solving the homogeneous system Ax = 0.

The method is Gauss-Jordan elimination. Reduce A to reduced row echelon form (RREF). Columns that contain a leading 1 are pivot columns; the remaining columns are free. Each free variable can take any value, and each pivot variable is then determined from its row. Setting one free variable to 1 and the others to 0 gives one basis vector, so there is one vector per free column.

The dimension of the null space is the nullity, which equals the number of free columns. The rank-nullity theorem says rank + nullity = number of columns. A matrix whose null space contains only the zero vector has nullity 0, which means its columns are linearly independent.

The column space is the span of the columns. A basis is given by the pivot columns of the original matrix (not the RREF).

Worked Examples

Example 1: Null space of a rank-deficient 3x3 matrix

Problem: Find a basis for the null space of the matrix with rows (1, 2, 3), (4, 5, 6) and (7, 8, 9).

Solution: Row reduce: the RREF has rows (1, 0, -1), (0, 1, 2) and (0, 0, 0). Pivot columns are 1 and 2, and column 3 is free. Set x3 = 1: then x1 = x3 = 1 and x2 = -2 x3 = -2. Check against the original rows: 1 - 4 + 3 = 0, 4 - 10 + 6 = 0, 7 - 16 + 9 = 0.

Answer: Basis: (1, -2, 1). Rank 2, nullity 1

Example 2: Two free variables in a 2x4 matrix

Problem: Find the null space of the matrix with rows (1, 2, 1, 0) and (2, 4, 3, 1).

Solution: Subtract 2 x row 1 from row 2 to get (0, 0, 1, 1). Subtract the new row 2 from row 1 to get (1, 2, 0, -1). RREF is (1, 2, 0, -1) and (0, 0, 1, 1). Pivot columns are 1 and 3; free columns are 2 and 4. With x2 = 1, x4 = 0: x1 = -2, x3 = 0. With x2 = 0, x4 = 1: x1 = 1, x3 = -1.

Answer: Basis: (-2, 1, 0, 0) and (1, 0, -1, 1). Rank 2, nullity 2

Example 3: An invertible matrix has a trivial null space

Problem: Find the null space of the matrix with rows (2, 1) and (1, 1).

Solution: The determinant is 2 x 1 - 1 x 1 = 1, which is not zero. Row reduction gives the identity matrix, so both columns are pivot columns and there are no free variables. The only solution of Ax = 0 is x = 0.

Answer: Null space = {0}, nullity 0, rank 2

Frequently Asked Questions

What is the null space of a matrix?
It is the set of all vectors that the matrix sends to zero. Equivalently, it is the complete solution set of the homogeneous system Ax = 0. It is a subspace, and the calculator returns a basis for it.
How do I find the null space by hand?
Row reduce the matrix to RREF, identify the free columns, and for each free column build a vector by setting that variable to 1, the other free variables to 0, and solving for the pivot variables. Those vectors form a basis.
What is nullity?
Nullity is the dimension of the null space, which equals the number of free columns in the RREF. By the rank-nullity theorem, rank + nullity equals the number of columns.
When is the null space just the zero vector?
When every column is a pivot column, so the columns are linearly independent. For a square matrix that is the same as having a non-zero determinant.
Is the basis unique?
No. Any basis of the same subspace is valid, and different methods may scale or combine the vectors differently. What is fixed is the dimension and the span.
Why does the answer use columns, not rows?
The null space is a set of vectors x with as many entries as the matrix has columns, because A x multiplies each column by an entry of x. The vectors for the left null space would use the transpose.

Related Linear Algebra Calculators

Related Articles