Null Space Calculator

Enter a matrix (up to 5×5) to find a basis for its null space (kernel) — all solutions to Ax = 0 — along with the matrix's rank, nullity, and reduced row echelon form.

Quick Facts

Definition
N(A) = {x : Ax = 0}
The null space is the set of all vectors that A maps to the zero vector.
Rank-nullity theorem
rank(A) + nullity(A) = n
n is the number of columns; nullity is the dimension of the null space.
Basis vectors
One per free variable in RREF
Set each free variable to 1 (others to 0) and solve the pivot variables.
Trivial null space
Nullity = 0 means only x = 0 solves Ax = 0
This happens exactly when the matrix's columns are linearly independent.

Your Results

Calculated
Nullity
-
Dimension of the null space
Rank
-
rank(A) = columns − nullity
Null Space Basis
-
Vectors x such that Ax = 0; any linear combination is also a solution
Reduced Row Echelon Form
-
Result of Gauss-Jordan elimination on the matrix

Ready

Enter matrix dimensions and values, then press Calculate.

Formula and Method for the Null Space of a Matrix

The null space (also called the kernel) of an m×n matrix A is the set of every vector x that satisfies the homogeneous equation Ax = 0. It always contains at least the zero vector, and it forms a subspace of Rn — meaning any linear combination of solutions is also a solution. The number of independent vectors needed to span that subspace is called the nullity of A, and it is linked to the matrix's rank by the rank-nullity theorem: rank(A) + nullity(A) = n.

How the calculation works

Enter the number of rows and columns (up to 5×5) and type the matrix, one row per line, with entries separated by spaces or commas. The calculator uses Gauss-Jordan elimination to reduce A to its reduced row echelon form (RREF): it picks a pivot in each column (swapping rows as needed for numerical stability), scales the pivot row so the pivot equals 1, and clears every other entry in that column, both above and below the pivot. Columns that end up without a pivot correspond to free variables in the system Ax = 0. For each free variable, the calculator sets that variable to 1, sets every other free variable to 0, and reads the pivot variables directly off the RREF rows (each pivot variable equals the negative of the RREF entry in the free column). The resulting vector is one basis vector for the null space; the total count of free variables equals the nullity.

Common mistakes

  • Wrong entry count: each row must contain exactly as many numbers as the selected column count, and the textarea must contain exactly as many rows as selected — extra or missing entries will be rejected.
  • Confusing null space with row space or column space: the null space lives in Rn (the input/domain space) and answers "what does A send to zero?" — it is not the same subspace as the column space, which lives in Rm and answers "what outputs can A produce?"
  • Assuming a matrix always has a nontrivial null space: if A has full column rank (rank = n), the only solution to Ax = 0 is x = 0 — the null space is trivial, containing just the zero vector, and nullity is 0.

Real-world applications

  • Solving homogeneous systems of linear equations directly: any physical system described by Ax = 0 (equilibrium conditions, balanced circuits, conservation laws) has its full solution set described by the null space basis.
  • Detecting linear dependence among columns: a nonzero null space vector gives the exact combination of columns that sums to zero, which is how it is used to identify redundant variables in regression and data matrices.
  • Control theory and robotics use the null space of a Jacobian to find joint motions that do not change a robot's end-effector position (useful for avoiding obstacles without disturbing a task).
  • Computer graphics and structural engineering use null spaces to find "free" deformation modes or degrees of freedom left unconstrained by a system of equations.

Frequently Asked Questions

What is the null space of a matrix?
The null space (or kernel) of an m by n matrix A is the set of all vectors x that satisfy Ax = 0. It always contains the zero vector, and it is a subspace of R^n whose dimension is called the nullity of A.
How do you find a basis for the null space?
Reduce the matrix to reduced row echelon form (RREF). Columns without a pivot correspond to free variables. For each free variable, set it to 1 and the other free variables to 0, then solve the pivot variables from the RREF rows — each resulting vector is one basis vector for the null space.
What is the rank-nullity theorem?
For an m by n matrix A, rank(A) + nullity(A) = n, the number of columns. So a 3×3 matrix with rank 2 has a null space of dimension 1, and a 3×3 matrix with rank 3 has only the zero vector in its null space.
What does it mean if the null space contains only the zero vector?
A null space containing only the zero vector (nullity = 0) means the matrix's columns are linearly independent, so Ax = 0 has only the trivial solution x = 0. For a square matrix, this also means the matrix is invertible and has a nonzero determinant.