ZestCalc

Matrix Rank Calculator

Find the rank and nullity of any matrix with exact fractions, get a basis for all four fundamental subspaces, and see what the matrix collapses.

Matrix

Enter a matrix of any shape, or start from an example.

Up to 12 rows and 12 columns.

Use integers, decimals, or fractions such as 1/3. Paste rows from a spreadsheet or a Python list into any cell.

Input

A=[1203241736110]A = \begin{bmatrix} 1 & 2 & 0 & 3 \\ 2 & 4 & 1 & 7 \\ 3 & 6 & 1 & 10 \end{bmatrix}

Rank and subspaces

Updates as you type.

Rank
2
Nullity
2

Rank + nullity = 2 + 2 = 4, the number of columns.

Column spaceDimension 2

Every output the matrix can produce. Basis: the pivot columns of A, not of the RREF.

{[123],  [011]}\left\{ \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix},\; \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix} \right\}

Row spaceDimension 2

Every combination of the rows. Basis: the nonzero rows of the RREF.

{[1203],  [0011]}\left\{ \begin{bmatrix} 1 \\ 2 \\ 0 \\ 3 \end{bmatrix},\; \begin{bmatrix} 0 \\ 0 \\ 1 \\ 1 \end{bmatrix} \right\}

Null spaceDimension 2

Every input the matrix sends to zero, the solutions of Ax = 0. Basis: one vector per free column.

{[−2100],  [−30−11]}\left\{ \begin{bmatrix} -2 \\ 1 \\ 0 \\ 0 \end{bmatrix},\; \begin{bmatrix} -3 \\ 0 \\ -1 \\ 1 \end{bmatrix} \right\}

Left null spaceDimension 1

The combinations of rows that cancel to zero, the solutions of yᵀA = 0. Basis: the null space of Aᵀ.

{[−1−11]}\left\{ \begin{bmatrix} -1 \\ -1 \\ 1 \end{bmatrix} \right\}

Work it out

1203
2417
36110

Row operations don't change the rank, so reduce the matrix and count the pivots.

Step 0 of 3
Show all 3 row operations

Building the null space

Each free column gives one basis vector. Set that free variable to 1 and the others to 0, then read each pivot variable from its row of the RREF.

Free column 2, so x2x_{2} = 1:

v1=[−2100]v_{1} = \begin{bmatrix} -2 \\ 1 \\ 0 \\ 0 \end{bmatrix}

Free column 4, so x4x_{4} = 1:

v2=[−30−11]v_{2} = \begin{bmatrix} -3 \\ 0 \\ -1 \\ 1 \end{bmatrix}

What rank means

The rank of a matrix is the number of independent directions it preserves. It has several equivalent descriptions:

  • The number of pivots after row reduction.
  • The dimension of the column space, the set of all outputs AxAx.
  • The dimension of the row space.

That the last two always match is a surprising fact: a matrix has exactly as many independent rows as independent columns, whatever its shape.

The four fundamental subspaces

An m×nm \times n matrix of rank rr comes with four subspaces:

SubspaceWhat it holdsDimension
Column spaceAll outputs AxAxrr
Row spaceAll combinations of the rowsrr
Null spaceAll xx with Ax=0Ax = 0n−rn - r
Left null spaceAll yy with yTA=0y^{T}A = 0m−rm - r

The dimensions in the first and third rows give the rank-nullity theorem:

rank⁡(A)+nullity⁡(A)=n\operatorname{rank}(A) + \operatorname{nullity}(A) = n

Every input dimension either survives into the output or is lost to zero.

Tips for using the calculator

  • A basis for the column space uses the pivot columns of the original matrix. Row operations change the column space, so the columns of the RREF generally aren't in it.
  • Open Steps to see how each free variable produces one null space vector.
  • Open See with a 2×22 \times 2 matrix to watch the image and the null space trade places as the rank changes.
  • Decimals are shown rounded, but the rank is computed exactly, so a tiny value such as 10−3010^{-30} still counts as nonzero. That differs from numerical tools, which treat very small values as 00.

The row reduction itself is explained in the RREF Calculator. A square matrix of full rank has an inverse, which you can find in the Matrix Inverse Calculator, and a nonzero value in the Determinant Calculator.