# What is the null space of this matrix?

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.

- Page: https://www.acalculator.org/math/null-space-calculator
- JSON spec: https://www.acalculator.org/math/null-space-calculator.json
- Version: 784ee64ed3b3

## Default answer

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].

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| m | Matrix A | The matrix A, 1 to 10 rows and 1 to 10 columns. The null space is every vector x with Ax = 0. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| basis | Basis of the null space | One vector for each free column, as exact fractions; none when the null space is only the zero vector. |
| nullity | Nullity | The dimension of the null space: columns minus rank. |
| rank | Rank | The number of pivots in the RREF. |
| general | All solutions of Ax = 0 | Every solution, as a sum of the basis vectors times the free variables. |
| free | Free variables | The columns without a pivot, counted from 1. |
| pivots | Pivot columns | The columns with a leading 1 in the RREF, counted from 1. |
| rref | RREF of A | The reduced row echelon form, rows separated by semicolons. |
| steps | Steps | The RREF, the free variables, and each special solution. |

## 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.

## Assumptions

- 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

1. m = 1 or 2 or 2 or 4 gives rref = [1, 2, 0, −2; 0, 0, 1, 2; 0, 0, 0, 0], basis = [−2, 1, 0, 0], [2, 0, −2, 1], nullity = 2, rank = 2, free = x₂, x₄, general = 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).
2. m = 1 or 2 or 4 or 5 gives basis = [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).
3. m = 2 or 1 or 1 or 3 gives basis = the zero vector only, [0, 0], nullity = 0, rank = 2, free = 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).
4. m = 1 or 1 or undefined gives basis = [−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).
5. m = 0.5 or 0.25 or 1 or 0.5 gives basis = [−1/2, 1], rref = [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).

## FAQ

### 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.

## Sources

- 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), retrieved 2026-10-19. https://textbooks.math.gatech.edu/ila/dimension.html
- Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra, §2.9 The Rank Theorem: rank(A) + nullity(A) = n for a matrix with n columns, retrieved 2026-10-19. https://textbooks.math.gatech.edu/ila/rank-thm.html
- MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang), Lecture 7: Solving Ax = 0: pivot variables, special solutions (elimination works for every matrix; the RREF R describes the null space), retrieved 2026-10-19. https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-7-solving-ax-0-pivot-variables-special-solutions/
