Null space calculator

The null space, or kernel, of a matrix is the set of all vectors that the matrix sends to zero. It answers a deep question about a linear system: which inputs produce no output at all, and therefore how much freedom a solution has. This calculator works with a two by two matrix. You enter its four entries, and it computes the determinant, the rank (the number of independent rows or columns), the nullity (the dimension of the null space) and, when the null space is nontrivial, a basis vector that spans it. The rank-nullity theorem ties these together: for a matrix with two columns, the rank plus the nullity always equals two. If the determinant is nonzero the matrix is invertible, the rank is two, the nullity is zero and only the zero vector maps to zero. If the determinant is zero the rows are dependent, the rank drops to one and the null space becomes a line through the origin, described by a single basis vector. Enter your own matrix to study a linear system or check an exercise. Every figure here is computed deterministically from the standard definitions, shown in full below with a worked example that reconciles exactly to the calculator.

The null space is every vector the matrix maps to zero; its dimension is the nullity, with rank plus nullity = number of columns. For the matrix [[1, 2], [2, 4]] the determinant is 0, the rank is 1, the nullity is 1, and a basis vector is (-2, 1).

Source: US National Aeronautics and Space Administration (NASA). As at 25 June 2026.

Determinant--
Rank / nullity--
Null space basis--

Null space of a 2x2 matrix

matrix M = [[a, b], [c, d]]
determinant = a d - b c
det != 0 -> rank 2, nullity 0, null space = 0
det = 0, row not all zero -> rank 1, nullity 1
basis from a x + b y = 0, e.g. (-b, a) when (a, b) is nonzero

The determinant decides everything. A nonzero determinant means the matrix is invertible and only the zero vector is in the null space. A zero determinant means the rows are proportional, the rank is one, and the null space is the line of vectors satisfying the first row equation, spanned by a single basis vector.

Worked example

Find the null space of the matrix [[1, 2], [2, 4]].

  1. Determinant = (1)(4) - (2)(2) = 4 - 4 = 0
  2. The determinant is zero, so the rank is 1 and the nullity is 2 - 1 = 1
  3. Solve the first row: 1 x + 2 y = 0, so x = -2 y
  4. Choose y = 1, giving x = -2
  5. A basis vector for the null space is (-2, 1)

The null space is one dimensional, spanned by (-2, 1). These are the calculator's default inputs, so the results above match the widget exactly.

Null space calculator: frequently asked questions

What is the null space of a matrix?

The null space, or kernel, of a matrix is the set of all vectors that the matrix maps to the zero vector. It always contains the zero vector and forms a subspace. Its dimension, called the nullity, measures how much information the matrix loses, or equivalently how much freedom a homogeneous solution has.

What is the rank-nullity theorem?

The rank-nullity theorem says that for any matrix the rank plus the nullity equals the number of columns. For a two by two matrix that total is two, so a rank of two forces a nullity of zero, and a rank of one forces a nullity of one. It is a precise accounting of dimensions.

When is the null space just the zero vector?

When the determinant is nonzero, the matrix is invertible and full rank, so the only vector it sends to zero is the zero vector itself. The nullity is then zero and the null space is called trivial. This happens whenever the rows, and columns, are linearly independent.

How do I read the basis vector?

The basis vector spans the null space: every vector in the null space is a scalar multiple of it. For the default matrix the basis is (-2, 1), so the null space is all vectors of the form t times (-2, 1) for any number t, a line through the origin.

Does this handle larger matrices?

This calculator covers the two by two case, which captures the core ideas of rank, nullity and basis. Larger matrices follow the same definitions but require row reduction to find the kernel. The two by two arithmetic here is deterministic and reconciles exactly to the worked example.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.