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
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.
- 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.
- The matrix does not have to be square — a wide matrix, with more columns than rows, always has a non-trivial null space.
- Read the basis at the top. Each vector is one special solution, obtained by setting one free variable to 1.
- Read the nullity for the dimension of the null space, and check it against rank plus nullity equalling the number of columns.
- Read the parametric solution to see every solution of Ax = 0 at once, one free parameter per basis vector.
- Verify any vector yourself by multiplying it back through your matrix — every entry of the product must come out zero.
- 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.
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.
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.
Frequently asked questions.
What is the null space of a matrix?
How do you find a basis for the null space?
What is the rank–nullity theorem?
Why is my basis different from the one shown here?
What does an empty null space mean?
Can a non-square matrix have a null space?
References& sources.
- [1]Margalit, D. & Rabinoff, J., Interactive Linear Algebra (Georgia Institute of Technology, 2019), §Subspaces — defines Nul(A) as the subspace of all solutions of Ax = 0, and gives the recipe this page implements: the vectors attached to the free variables in the parametric vector form of the solution set form a spanning set for Nul(A). Retrieved 2026-07-29; open access.
- [2]Wolfram MathWorld, "Null Space" — independent statement of the definition, Null(T) = {X : T(X) = 0}, and confirmation that kernel is a synonym. Used as the second authority on the trivial-null-space boundary. Retrieved 2026-07-29; open access.
- [3]Margalit, D. & Rabinoff, J., Interactive Linear Algebra, §Dimension — the basis of Nul(A) drawn from the parametric vector form of the solution set. Retrieved 2026-07-29; open access.
- [4]Strang, G. (2016). Introduction to Linear Algebra, 5th ed., Wellesley–Cambridge Press. §3.2 "The Nullspace of A: Solving Ax = 0" — the special-solutions construction, and the source of the matrix used as this page's worked example. Print reference — cited bibliographically, with no URL.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled