Audited 29 Jul 2026·Last updated 31 Jul 2026·4 citations·Tier 2·0 uses

Null Space Calculator (Kernel of a Matrix)

Find a basis for the null space of a matrix, its nullity and the parametric solution of Ax = 0, with the reduced row echelon form shown as working.

Null Space Calculator

One row per line, up to 6 rows and 6 columns. Separate entries with commas or spaces. Fractions like 1/2 are accepted. The matrix does not need to be square.
Null space basis
(-2, 1, 0, 0), (2, 0, -2, 1)
A basis for Nul(A), built from the unique reduced row echelon form. This is one correct basis, not the only one — any other set of vectors spanning the same subspace is equally valid, so a different textbook answer is not necessarily a wrong one.
Nullity
2
Rank
2
What it means
Non-trivial — Nul(A) is a 2-dimensional subspace of R^4, so Ax = 0 has infinitely many solutions
Parametric solution
x = x2·(-2, 1, 0, 0) + x4·(2, 0, -2, 1)
Free variables
x2, x4
Reduced row echelon form
[1, 2, 0, -2; 0, 0, 1, 2; 0, 0, 0, 0]

Background.

This null space calculator finds a basis for the null space of a matrix — also called its kernel — along with the nullity, the rank, the free variables and the full parametric solution of Ax = 0. Enter the matrix one row per line; it does not need to be square, and it can be up to 6 by 6. The reduced row echelon form is shown too, because that is the working the answer is read from and you should be able to check it.

The null space of A is the set of every vector x that A sends to zero. It always contains the zero vector, since A0 = 0 for any matrix, so the real question is whether it contains anything else. When it does not, the null space is called trivial and the columns of A are linearly independent — no combination of them cancels out except the empty one. When it does, the null space is a whole subspace of directions that A collapses, and each extra dimension of it is one more way the columns of A depend on each other. That is why the null space is the standard tool for answering "are these vectors independent?" and "is this system's solution unique?" in one shot.

The computation runs through row reduction. Reduce A to its reduced row echelon form and note which columns hold pivots: those variables are determined, and the rest are free to choose. For each free variable in turn, set it to 1, set the other free variables to 0, and solve the pivot rows for the remaining unknowns. The vectors that fall out are Strang's special solutions, and together they form a basis for the null space. The number of them is the nullity, which is why the nullity always equals the number of free columns, and why rank plus nullity always equals the total number of columns — the rank–nullity theorem, which this page gives you as a free check on every answer.

One caveat belongs beside the result rather than buried in a note, because it causes more confusion than the arithmetic does: the basis returned here is one correct basis, not the only one. Because the reduced row echelon form of a matrix is unique, this page's answer is deterministic and reproducible, and setting each free variable to 1 in turn is the standard convention. But a subspace has infinitely many bases. If your textbook lists different vectors, scale them, add them together, and see whether they span the same space before assuming either answer is wrong. What is not a matter of convention is membership: every vector this page returns satisfies Ax = 0 exactly, and you can verify it by multiplying it back through A by hand — which is what the test suite for this calculator does on every returned vector rather than merely comparing strings.

The page shows exact fractions rather than decimals wherever a fraction with a denominator up to 1000 fits. Row reduction generates fractions constantly, since dividing by a pivot rarely gives whole numbers, and rounding them early is the classic way a hand computation goes wrong. All arithmetic here runs at 60 significant digits and nothing is rounded until the answer is displayed.

What is null space calculator?

The null space of an m × n matrix A, written Nul(A) and also called the kernel of A, is the set of all vectors x in Rⁿ satisfying Ax = 0. It is always a subspace of Rⁿ: it contains the zero vector, and it is closed under addition and scalar multiplication because A(x + y) = Ax + Ay and A(cx) = c(Ax). Its dimension is called the nullity of A. A basis for it is found by row reducing A to reduced row echelon form, identifying the pivot columns (whose variables are basic) and the remaining free columns, then producing one vector per free variable by setting that variable to 1 and the other free variables to 0 and solving the pivot rows for the basic variables. Those vectors are the special solutions, and the nullity is therefore exactly the number of free columns. Combined with the fact that the rank is the number of pivot columns, this gives the rank–nullity theorem: rank(A) + nullity(A) = n, the number of columns. The null space is trivial — equal to {0} — precisely when there are no free columns, which happens precisely when the columns of A are linearly independent, and for a square matrix precisely when A is invertible. A non-trivial null space means Ax = b, when it is solvable at all, has infinitely many solutions: any particular solution plus any null space vector is another solution.

How to use this calculator.

  1. Type your matrix one row per line, using commas or spaces between entries. A semicolon works instead of a line break, and fractions like 1/2 are accepted directly.
  2. The matrix does not have to be square — a wide matrix, with more columns than rows, always has a non-trivial null space.
  3. Read the basis at the top. Each vector is one special solution, obtained by setting one free variable to 1.
  4. Read the nullity for the dimension of the null space, and check it against rank plus nullity equalling the number of columns.
  5. Read the parametric solution to see every solution of Ax = 0 at once, one free parameter per basis vector.
  6. Verify any vector yourself by multiplying it back through your matrix — every entry of the product must come out zero.
  7. If the basis comes back empty, the null space is trivial: only the zero vector solves Ax = 0, and your columns are linearly independent.

The formula.

Nul(A) = { x : Ax = 0 } , rank + nullity = n

Row reduce A to its reduced row echelon form R. Because RREF is unique, R does not depend on which legal sequence of row operations you use, so the basis derived from it is deterministic. The columns of R that carry a leading 1 are the pivot columns; their variables are the basic variables. Every other column is free. Ax = 0 and Rx = 0 have exactly the same solution set, because every elementary row operation is reversible and none of them changes which x satisfy the system. Reading R row by row expresses each basic variable as a combination of the free ones. Setting one free variable to 1 and the rest to 0 then produces a single concrete solution, and doing that once per free variable produces a set of vectors that is both linearly independent — each has a 1 in a position where all the others have 0 — and spanning, since any solution is the combination of them with coefficients equal to its own free-variable values. That is a basis, so the nullity equals the number of free columns, and since every column is either pivot or free, rank plus nullity equals the number of columns. Nothing in this computation is rounded. All arithmetic runs at 60 significant digits, and an entry is treated as zero only when its magnitude falls at or below 1e-20 times the largest magnitude in the input matrix, a threshold that never fires on a matrix of exact decimals. Rounding is applied at display time only: an exact fraction is shown whenever one with a denominator up to 1000 matches, and 6 decimal places otherwise — so A = [2, 1] returns the basis vector (−1/2, 1) rather than (−0.5, 1). The trivial / non-trivial verdict compares the unrounded integer nullity against the unrounded column count, so no displayed value takes part in it.

A worked example.

Example

Take the 3 by 4 matrix A with rows (1, 2, 2, 2), (2, 4, 6, 8) and (3, 6, 8, 10). Eliminating the first column with R2 ← R2 − 2R1 and R3 ← R3 − 3R1 leaves both lower rows equal to (0, 0, 2, 4), so R3 ← R3 − R2 wipes the third row out entirely — the third row of A was the sum of the first two. Scaling with R2 ← ½R2 gives (0, 0, 1, 2), and R1 ← R1 − 2R2 gives (1, 2, 0, −2). The reduced row echelon form is therefore [1, 2, 0, −2; 0, 0, 1, 2; 0, 0, 0, 0], with pivots in columns 1 and 3. That makes x₂ and x₄ the free variables, so the rank is 2 and the nullity is 4 − 2 = 2, which checks out against rank plus nullity equalling the 4 columns. Setting x₂ = 1 and x₄ = 0, the first pivot row reads x₁ + 2 = 0 so x₁ = −2, and the second reads x₃ = 0, giving the special solution (−2, 1, 0, 0). Setting x₂ = 0 and x₄ = 1 instead, the first row reads x₁ − 2 = 0 so x₁ = 2, and the second reads x₃ + 2 = 0 so x₃ = −2, giving (2, 0, −2, 1). Both are worth checking by hand. Multiplying the first through A gives (1(−2) + 2(1), 2(−2) + 4(1), 3(−2) + 6(1)) = (0, 0, 0), and the second gives (2 − 4 + 2, 4 − 12 + 8, 6 − 16 + 10) = (0, 0, 0). Every solution of Ax = 0 is x = x₂(−2, 1, 0, 0) + x₄(2, 0, −2, 1) for any choice of the two parameters.

matrix1, 2, 2, 2 2, 4, 6, 8 3, 6, 8, 10

Frequently asked questions.

What is the null space of a matrix?
It is the set of every vector x that the matrix sends to zero — every solution of Ax = 0. It is always a subspace, and it always contains the zero vector, since A times the zero vector is zero for any A at all. The interesting question is whether it contains anything else. If it does not, the null space is called trivial and the columns of A are linearly independent. If it does, each dimension of the null space is one independent way the columns of A can be combined to cancel out. The kernel of A is another name for exactly the same thing.
How do you find a basis for the null space?
Row reduce the matrix to reduced row echelon form and see which columns hold pivots. The variables in the remaining columns are free. Take each free variable in turn, set it to 1 and the other free variables to 0, then solve the pivot rows for the rest. Each pass produces one vector, and together they form a basis. In the worked example the free variables are x₂ and x₄, so setting x₂ = 1 with x₄ = 0 gives (−2, 1, 0, 0), and setting x₄ = 1 with x₂ = 0 gives (2, 0, −2, 1). These are what Strang calls the special solutions.
What is the rank–nullity theorem?
Rank plus nullity equals the number of columns. The reason is simple once you see the mechanics: every column of the matrix ends up either holding a pivot or not. The pivot columns are counted by the rank, the non-pivot columns are the free variables and are counted by the nullity, and every column falls into exactly one of the two groups. In the worked example there are 4 columns, the rank is 2 and the nullity is 2. This makes an excellent check on any null space calculation — if your rank and nullity do not add up to the column count, something has gone wrong upstream.
Why is my basis different from the one shown here?
Probably because you parameterised the free variables differently, and both answers may be correct. A subspace has infinitely many bases; any set of independent vectors spanning the same space works. This page follows the standard convention of setting one free variable to 1 and the rest to 0, and because the reduced row echelon form is unique, that makes its answer deterministic and reproducible. To check whether your basis and this one agree, verify that each of your vectors satisfies Ax = 0 and that you have the same number of them as the nullity. If both hold, the two bases span the same subspace.
What does an empty null space mean?
It means the null space is trivial — Nul(A) = {0} — so the only solution of Ax = 0 is the zero vector. That happens exactly when every column holds a pivot, which is exactly when the columns of A are linearly independent. For a square matrix it is also equivalent to A being invertible, to a non-zero determinant, and to the reduced row echelon form being the identity. Practically it means that if Ax = b has a solution at all, that solution is unique: two different solutions would differ by a non-zero null space vector, and there aren't any.
Can a non-square matrix have a null space?
Yes, and the shape tells you a lot before you compute anything. The null space of an m by n matrix lives in Rⁿ, the space the matrix maps from, regardless of how many rows there are. If a matrix has more columns than rows, it must have a non-trivial null space, because the rank cannot exceed the number of rows, so the nullity is at least n − m, which is positive. A single row like (1, 2, 3) therefore has a 2-dimensional null space — the whole plane of vectors perpendicular to it, spanned by (−2, 1, 0) and (−3, 0, 1).

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 977 calculators remain free
  • No billing is enabled
Coming soon