Null Space Calculator (Kernel of a Matrix)
Find a basis for the null space (kernel) of any matrix up to 6 × 6, with nullity, rank, free variables, the parametric solution of Ax = 0 and the RREF working.
Null Space Calculator
Background.
Write down three equations in four unknowns with every right-hand side equal to zero, and you are asking for a null space. The zero vector always satisfies such a system. What matters is what else does, and when there are more unknowns than independent equations the answer is a whole family: a line, a plane or a higher-dimensional flat sheet passing through the origin.
The null space of a matrix A, also called its kernel, is exactly that family — every vector x with Ax = 0. Its basis vectors are more useful than they look, because each one is a recipe for combining the columns of A so that they cancel. In the worked example below, the basis vector (−2, 1, 0, 0) says that −2 times column 1 plus column 2 is zero, which is another way of saying column 2 is double column 1. When no such recipe exists the null space shrinks to the zero vector alone and the columns are linearly independent.
That single computation settles several questions that keep coming back in a linear algebra course and after it: whether a set of vectors is independent, whether a solution of Ax = b is unique or comes with free parameters, how many independent ways a chemical equation can be balanced, and which directions a linear map flattens to nothing.
Enter A one row per line, up to 6 rows and 6 columns, square or not. Back come a basis, the nullity and rank, the free variables, the general solution written in parametric form, and the reduced row echelon form the answer was read from, so you can follow every step by hand.
What is null space calculator?
For an m × n matrix A, the null space Nul(A) is the set of all vectors x in Rⁿ with Ax = 0. It lives in the space of inputs, so its vectors have one entry per column of A, not per row. It is always a subspace: it contains the zero vector, and sums and scalar multiples of solutions are solutions again, since A(x + y) = Ax + Ay and A(cx) = c·Ax. Its dimension is the nullity. Because Ax = 0 says that x has zero dot product with every row of A, the null space is also the set of vectors perpendicular to the whole row space. It is trivial, {0}, exactly when the columns of A are linearly independent; for a square matrix that is the same as A being invertible, with a non-zero determinant.
How to use this calculator.
- Type Matrix A with one row per line and commas or spaces between entries; a semicolon also ends a row. Every row needs the same number of entries, with at most 6 rows and 6 columns and each entry between −1,000,000,000 and 1,000,000,000.
- Use fractions such as 1/3 instead of 0.333. Entries are taken exactly as typed, so a rounded decimal can turn a matrix whose columns depend on each other into one whose columns do not.
- Read the verdict and the nullity first: nullity 0 means only the zero vector solves Ax = 0, and nullity equal to the number of columns happens only for the zero matrix.
- Copy the basis from the top line, or use the parametric solution when you want every solution written out with the free variables as parameters.
- If a textbook lists different vectors, compare reduced row echelon forms first, since that matrix is unique, then multiply the textbook vectors through A to confirm each gives zero.
The formula.
The definition is Nul(A) = { x : Ax = 0 }, and the method is row reduction. Reduce A to its reduced row echelon form R. Each elementary row operation can be undone, so Rx = 0 has exactly the same solutions as Ax = 0, and R is unique: every legal sequence of row operations ends at the same matrix. Columns of R containing a leading 1 are pivot columns, and their variables are basic; every other column is free. For each free column j, build one vector: put 1 in position j, 0 in the other free positions, and in the position of the pivot from row i put the negative of R's entry in row i, column j. In other words, a basis vector is the free column of R with its signs flipped and a 1 inserted. These are Strang's special solutions. They are independent, because each has a 1 where all the others have 0, and they span, because any solution equals the sum of its own free-variable values times the matching special solutions. So the nullity is the number of free columns, and since every column is either pivot or free, rank + nullity = n, the column count. Entries are displayed as exact fractions whenever a denominator up to 1,000 fits, otherwise to 6 decimal places.
A worked example.
Take A with rows (1, 2, 2, 2), (2, 4, 6, 8) and (3, 6, 8, 10). Subtracting 2 × row 1 from row 2 and 3 × row 1 from row 3 leaves both lower rows equal to (0, 0, 2, 4); subtracting row 2 from row 3 then clears row 3 completely, because the original third row was the sum of the first two. Halving row 2 gives (0, 0, 1, 2), and subtracting 2 × that from row 1 gives (1, 2, 0, −2). So R = [1, 2, 0, −2; 0, 0, 1, 2; 0, 0, 0, 0], with pivots in columns 1 and 3. That leaves x2 and x4 free, so the rank is 2 and the nullity is 4 − 2 = 2. Setting x2 = 1, x4 = 0, the first row of R reads x1 + 2 = 0 and the second reads x3 = 0, giving (−2, 1, 0, 0). Setting x2 = 0, x4 = 1, the rows read x1 − 2 = 0 and x3 + 2 = 0, giving (2, 0, −2, 1). The basis is therefore (−2, 1, 0, 0), (2, 0, −2, 1), and every solution is x = x2·(−2, 1, 0, 0) + x4·(2, 0, −2, 1). Multiplying back confirms both: A times the first vector is (−2 + 2, −4 + 4, −6 + 6) = (0, 0, 0), and A times the second is (2 − 4 + 2, 4 − 12 + 8, 6 − 16 + 10) = (0, 0, 0). Read as column relations, the two vectors say column 2 = 2 × column 1 and column 4 = 2 × column 3 − 2 × column 1: only columns 1 and 3 carry independent information.
Frequently asked questions.
My textbook's null space basis has different vectors. Is one of us wrong?
Why do MATLAB and SciPy give decimals like 0.8944 instead of whole numbers?
Why did typing 0.333333 instead of 1/3 change the nullity?
How does the null space help me solve Ax = b?
Can I find a particular solution of Ax = b with a null space calculation?
How do I get eigenvectors from a null space?
Why must a wide matrix always have a non-trivial 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.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 4 cited below
- Method
- Nul(A) = { x : Ax = 0 } , rank + nullity = n
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled