gives a list of vectors that forms a basis for the null space of the matrix m.

Details and Options

  • NullSpace works on both numerical and symbolic matrices.
  • The following options can be given:
  • MethodAutomaticmethod to use
    Modulus0integer modulus to use
    ToleranceAutomaticnumerical tolerance to use
    ZeroTestAutomaticfunction to test whether matrix elements should be considered to be zero
  • NullSpace[m,Modulus->n] finds null spaces for integer matrices modulo n.
  • NullSpace[m,ZeroTest->test] evaluates test[m[[i,j]]] to determine whether matrix elements are zero.
  • Possible settings for the Method option include "CofactorExpansion", "DivisionFreeRowReduction", and "OneStepRowReduction". The default setting of Automatic switches among these methods depending on the matrix given.


open allclose all

Basic Examples  (1)

Find the null space of a 3×3 matrix:

The action of m on the vector is the zero vector:

Scope  (10)

Basic Uses  (6)

Null space of a machine-precision matrix:

Null space of a complex matrix:

Null space of an exact matrix:

Find the null space symbolically:

Null space of non-square matrices:

The null space of a large numerical matrix is computed efficiently:

Special Matrices  (4)

Null space of a sparse matrix:

Null space of structured matrices:

IdentityMatrix[n] always has an empty null space::

The null space of IdentityMatrix[{m,n}] is non-empty:

Compute the null space for HilbertMatrix:

Options  (1)

Modulus  (1)

m is a 3×3 random matrix of integers between 0 and 4:

Use arithmetic modulo 5 to compute the null space:

The vector is in the null space modulo 5:

Applications  (2)

m is a 3×3 singular matrix with a nonempty null space:

Find a solution for :

All solutions are given by , where is any vector in the null space:

Find a basis for the eigenspace for a particular eigenvalue:

Properties & Relations  (2)

m is a 5×5 matrix:

The null space of m:

Arbitrary linear combinations of the null space of m give zero:

m is a 3×4 matrix of random zeros and ones:

The MatrixRank equals the column dimension of m minus the dimension of the null space:

Wolfram Research (1988), NullSpace, Wolfram Language function, (updated 1996).


Wolfram Research (1988), NullSpace, Wolfram Language function, (updated 1996).


@misc{reference.wolfram_2020_nullspace, author="Wolfram Research", title="{NullSpace}", year="1996", howpublished="\url{}", note=[Accessed: 19-January-2021 ]}


@online{reference.wolfram_2020_nullspace, organization={Wolfram Research}, title={NullSpace}, year={1996}, url={}, note=[Accessed: 19-January-2021 ]}


Wolfram Language. 1988. "NullSpace." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996.


Wolfram Language. (1988). NullSpace. Wolfram Language & System Documentation Center. Retrieved from