🧮
🧮 Math & statistics

Null Space Calculator (basis of Nul A, nullity and the solutions of Ax = 0)

Results update as you type.

Your numbers

Understanding the null space calculator — concept and principle

This calculator finds the null space (kernel) of a matrix A: every vector x with Ax = 0. It returns a basis, the nullity, the rank, the free variables, the general solution and the reduced row echelon form (RREF). Use it in linear algebra courses, to test whether columns are linearly independent, or to describe all solutions of a homogeneous system.

Null space of a 3×3 matrixA · x = 0123456789·1-21=0001−4+34−10+67−16+9Basis of Nul(A)(1, −2, 1)rank 2 + nullity 1 = 3 columns
Every row of A dotted with (1, −2, 1) gives 0, so this vector spans the null space.

How it is calculated

  1. Row-reduce A to RREF.
  2. Columns with a leading 1 are pivot columns; the other variables are free.
  3. Solve each pivot variable in terms of the free variables.
  4. For each free variable, set it to 1 and the other free variables to 0; the resulting vector is one basis vector.

Nullity = number of free variables, and rank + nullity = n (the number of columns). Enter rows separated by semicolons and entries by spaces or commas; up to 8 × 8.

The principle

Row operations (swapping rows, scaling a row, adding a multiple of one row to another) do not change the solution set of Ax = 0, so the RREF has the same null space as A but is easy to read. Each free variable can take any value, and the pivot variables are then fixed. Writing the solution as x = t₁u₁ + t₂u₂ + … shows that the null space is spanned by the vectors u₁, u₂, …, and they are independent because each has a 1 in its own free position where the others have 0. The rank-nullity theorem says each column is either a pivot or a free direction.

Worked example

Default matrix: A = [1 2 3; 4 5 6; 7 8 9].

  1. R2 − 4R1 = (0, −3, −6), R3 − 7R1 = (0, −6, −12).
  2. Scale R2 by −1/3 to (0, 1, 2); R3 + 6R2 = (0, 0, 0).
  3. R1 − 2R2 = (1, 0, −1). RREF = [1 0 −1; 0 1 2; 0 0 0].
  4. Pivots in columns 1 and 2, so rank = 2 and x₃ is free.
  5. x₁ = x₃ and x₂ = −2x₃. With x₃ = 1 the basis vector is (1, −2, 1); nullity = 1; general solution x = t₁·(1, −2, 1).

How to read the result

Nullity 0 means only the zero vector solves Ax = 0: the columns are linearly independent, and a square matrix is then invertible. Nullity above 0 means some combination of columns cancels out; the basis vectors give the exact combinations. Here 1·col1 − 2·col2 + 1·col3 = 0. A basis is not unique: any non-zero multiple, such as (−1, 2, −1), is equally correct.

Common mistakes

Keep in mind: Entries are processed in floating point. Values extremely close to zero are treated as zero, so nearly singular matrices with very small or very large entries may need exact arithmetic.

Frequently asked questions

What is the difference between null space and kernel?

They are the same set. "Kernel" is used for linear maps and "null space" for matrices.

Does the null space always contain the zero vector?

Yes. A·0 = 0 for every matrix, so the null space is never empty.

How do I check a basis vector?

Multiply A by it. For (1, −2, 1): 1 − 4 + 3 = 0, 4 − 10 + 6 = 0 and 7 − 16 + 9 = 0.

Sources: D. Margalit & J. Rabinoff, Interactive Linear Algebra, §2.7 Basis and Dimension · Wolfram MathWorld, "Fundamental Theorem of Linear Algebra"

Checked 9 Nov 2026. D. Margalit & J. Rabinoff, Interactive Linear Algebra, §2.7 Basis and Dimension — Theorem 2 (the vectors attached to the free variables in the parametric vector form of the solution set of Ax = 0 form a basis of Nul(A)); Wolfram MathWorld, “Fundamental Theorem of Linear Algebra” (dim Nul(A) = n − rank; the null space is orthogonal to the row space).

🧮 All math & statistics tools →🌍 Calculators by country →