What is the null space of this matrix?
Type a matrix to find its null space: every vector x with Ax = 0. The null space calculator reduces the matrix to RREF and gives a basis, the nullity, the rank and the free variables, in exact fractions.
- Basis of the null space
- [−2, 1, 0, 0], [2, 0, −2, 1]
The null space has dimension 2, with basis [−2, 1, 0, 0], [2, 0, −2, 1].
- Nullity
- 2
- Rank
- 2
- All solutions of Ax = 0
- x = x₂·[−2, 1, 0, 0] + x₄·[2, 0, −2, 1]
- Free variables
- x₂, x₄
- Pivot columns
- 1, 3
- RREF of A
- [1, 2, 0, −2; 0, 0, 1, 2; 0, 0, 0, 0]
- Steps
- RREF: [1, 2, 0, −2; 0, 0, 1, 2; 0, 0, 0, 0]; Pivot columns: 1, 3; free variables: x₂, x₄; Set x₂ = 1 and the other free variables to 0: [−2, 1, 0, 0]; Set x₄ = 1 and the other free variables to 0: [2, 0, −2, 1]; Nullity = 4 columns − rank 2 = 2
Basis of the null space: [−2, 1, 0, 0], [2, 0, −2, 1]. The null space has dimension 2, with basis [−2, 1, 0, 0], [2, 0, −2, 1].
How it is worked out
How to calculate
Finds a basis of the null space (kernel) of a matrix from its reduced row echelon form, in exact fractions, with the nullity, the rank, the free variables and the general solution of Ax = 0.
Example with the default inputs (Matrix A [1, 2, 2, 2; 2, 4, 6, 8; 3, 6, 8, 10]): The null space has dimension 2, with basis [−2, 1, 0, 0], [2, 0, −2, 1].
Method: Reduce A to its RREF by Gauss-Jordan elimination. For each free column j, set x_j = 1 and the other free variables to 0; each pivot variable is minus the entry of column j in its pivot row. These special solutions are a basis of the null space.
- Every entry is read as an exact fraction: a decimal such as 0.1 is 1/10, so there is no rounding.
- The matrix has 1 to 10 rows and 1 to 10 columns.
Worked examples
Each example is checked against the calculator on every build.
- Matrix A 1, 2, 2, 2; 2, 4, 6, 8; 3, 6, 8, 10 gives RREF of A [1, 2, 0, −2; 0, 0, 1, 2; 0, 0, 0, 0], Basis of the null space [−2, 1, 0, 0], [2, 0, −2, 1], Nullity 2, Rank 2, Free variables x₂, x₄, All solutions of Ax = 0 x = x₂·[−2, 1, 0, 0] + x₄·[2, 0, −2, 1].Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.7 Basis and Dimension (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)) and §2.9 The Rank Theorem (rank(A) + nullity(A) = n), https://textbooks.math.gatech.edu/ila/dimension.html and https://textbooks.math.gatech.edu/ila/rank-thm.html (retrieved 2026-10-19); MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang), Lecture 7: Solving Ax = 0: pivot variables, special solutions (reducing to the RREF R describes the null space), https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-7-solving-ax-0-pivot-variables-special-solutions/ (retrieved 2026-10-19)
- Matrix A 1, 2, 3; 4, 5, 6; 7, 8, 9 gives Basis of the null space [1, −2, 1], Nullity 1, Rank 2.Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.7 Basis and Dimension (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)) and §2.9 The Rank Theorem (rank(A) + nullity(A) = n), https://textbooks.math.gatech.edu/ila/dimension.html and https://textbooks.math.gatech.edu/ila/rank-thm.html (retrieved 2026-10-19)
- Matrix A 2, 1; 1, 3 gives Basis of the null space the zero vector only, [0, 0], Nullity 0, Rank 2, Free variables none.Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.7 Basis and Dimension (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)) and §2.9 The Rank Theorem (rank(A) + nullity(A) = n), https://textbooks.math.gatech.edu/ila/dimension.html and https://textbooks.math.gatech.edu/ila/rank-thm.html (retrieved 2026-10-19)
- Matrix A 1, 1, 1 gives Basis of the null space [−1, 1, 0], [−1, 0, 1], Nullity 2.Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.7 Basis and Dimension (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)) and §2.9 The Rank Theorem (rank(A) + nullity(A) = n), https://textbooks.math.gatech.edu/ila/dimension.html and https://textbooks.math.gatech.edu/ila/rank-thm.html (retrieved 2026-10-19)
- Matrix A 0.5, 0.25; 1, 0.5 gives Basis of the null space [−1/2, 1], RREF of A [1, 1/2; 0, 0].Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.7 Basis and Dimension (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)) and §2.9 The Rank Theorem (rank(A) + nullity(A) = n), https://textbooks.math.gatech.edu/ila/dimension.html and https://textbooks.math.gatech.edu/ila/rank-thm.html (retrieved 2026-10-19)
How it works
The null space of an m × n matrix A is the set of all vectors x with Ax = 0.
- RREF. Reduce A to its reduced row echelon form R by Gauss-Jordan elimination, as the RREF calculator does: for each column from the left, the first remaining row with a nonzero entry becomes the pivot row; it is swapped up, scaled so the pivot is 1, and subtracted from every other row to clear the column. Ax = 0 and Rx = 0 have the same solutions.
- Pivot and free variables. A column of R with a leading 1 is a pivot column; each other column j gives a free variable x_j.
- Special solutions. For each free column j: set x_j = 1 and every other free variable to 0. Row r of R holds the pivot of some column p, and gives x_p = −R[r][j]. The vector is the special solution for x_j.
- Basis. The special solutions, in the order of their free columns, are a basis of the null space (Interactive Linear Algebra §2.7). Their number is the nullity, n − rank (the Rank Theorem).
When every column has a pivot, the null space is only the zero vector and the nullity is 0.
Rules
- The matrix has 1 to 10 rows and 1 to 10 columns. Each cell is an integer, a decimal or a fraction. A cell typed as a fraction (1/3 or 3/2) is read as that exact fraction, and a decimal as its exact value (0.25 is 1/4), so all the arithmetic is exact.
Output format
- Every entry is an exact fraction in lowest terms, written as an integer or as p/q, with the true minus sign (−). A vector is written in square brackets with its entries separated by commas: [−2, 1, 0, 0]. Matrices are written row by row in square brackets, rows separated by semicolons: [1, 2, 0, −2; 0, 0, 1, 2; 0, 0, 0, 0].
- Basis: the special solutions, separated by commas, in the order of their free columns; with no free variables,
the zero vector only, [0, 0, …]with n zeros. - All solutions of Ax = 0:
x = x₂·[…] + x₄·[…], each free variable (named x with its column number as subscript digits) times its special solution; with no free variables,x = [0, 0, …]. - Free variables:
x₂, x₄, ornone. Pivot columns:1, 3, ornone. - Steps, separated by semicolons:
RREF: R;Pivot columns: …; free variables: …; for each free variableSet x_j = 1: v, with the words "and the other free variables to 0" (after a space) before the colon when there are two or more free variables; thenNullity = n columns − rank r = k. Example: Set x₂ = 1 and the other free variables to 0: [−2, 1, 0, 0]. - The answer sentence reads
The null space has dimension k, with basis B., with the nullity and the basis as above.
Worked examples by hand
A 3 × 4 matrix. A = [1, 2, 2, 2; 2, 4, 6, 8; 3, 6, 8, 10].
- R2 → R2 − 2 × R1 gives [0, 0, 2, 4]; R3 → R3 − 3 × R1 gives [0, 0, 2, 4].
- Column 2 has no nonzero entry below row 1, so it is free. In column 3, R2 → ½ × R2 gives [0, 0, 1, 2]; R1 → R1 − 2 × R2 gives [1, 2, 0, −2]; R3 → R3 − 2 × R2 gives [0, 0, 0, 0].
R = [1, 2, 0, −2; 0, 0, 1, 2; 0, 0, 0, 0]: pivot columns 1 and 3, free variables x₂ and x₄, rank 2.
- x₂ = 1, x₄ = 0: x₁ = −2, x₃ = 0, so [−2, 1, 0, 0].
- x₄ = 1, x₂ = 0: x₁ = −(−2) = 2, x₃ = −2, so [2, 0, −2, 1].
Nullity = 4 − 2 = 2. Every solution is x = x₂·[−2, 1, 0, 0] + x₄·[2, 0, −2, 1]. Check: A × [−2, 1, 0, 0] = [−2 + 2, −4 + 4, −6 + 6] = 0.
A 3 × 3 matrix of rank 2. [1, 2, 3; 4, 5, 6; 7, 8, 9] reduces to [1, 0, −1; 0, 1, 2; 0, 0, 0]. x₃ is free: x₃ = 1 gives x₁ = 1 and x₂ = −2, so the basis is [1, −2, 1] and the nullity is 1.
An invertible matrix. [2, 1; 1, 3] has a pivot in both columns, so the null space is the zero vector only, [0, 0], and the nullity is 0.
One equation. [1, 1, 1] is already in RREF. x₂ and x₃ are free: [−1, 1, 0] and [−1, 0, 1], nullity 2.
Decimals. [0.5, 0.25; 1, 0.5] is [1/2, 1/4; 1, 1/2]. R1 → 2 × R1 gives [1, 1/2]; R2 → R2 − R1 gives [0, 0]. R = [1, 1/2; 0, 0]; x₂ = 1 gives x₁ = −1/2: [−1/2, 1].
Other questions people ask
How do you find the null space of a matrix?
Reduce the matrix to reduced row echelon form. Each column without a pivot is a free variable. For each free variable, set it to 1 and the other free variables to 0, and read each pivot variable from its row: it is minus the entry in that free column. These special solutions are a basis of the null space.
What is the nullity of a matrix?
The dimension of its null space: the number of free variables. By the Rank Theorem, rank + nullity = the number of columns, so a 3 × 4 matrix of rank 2 has nullity 4 − 2 = 2.
Is the null space the same as the kernel?
Yes. The null space of A is the kernel of the linear map x ↦ Ax: every input that maps to the zero vector.
What if the null space is only the zero vector?
Then every column has a pivot and Ax = 0 has only the solution x = 0. The nullity is 0 and the columns of A are linearly independent; a square matrix like this is invertible.
Why is my basis different from my textbook’s?
A null space has many bases. The page gives the special solutions, with each free variable set to 1 in turn. Any basis your book gives spans the same space: each of its vectors is a combination of these.
Can I type fractions or decimals?
Yes. Each entry is read as an exact fraction (0.25 is 1/4, and a cell may hold 1/3), and the elimination is exact, so the basis has no rounding.