Matrix Rank and Nullity Calculator

Find the numerical rank and nullity of a real rectangular matrix. Inspect its RREF, pivot and free columns, and bases for the null, column, and row spaces—entirely in your browser.

Enter a Matrix

A pivot no larger than this fraction of the largest entered magnitude is treated as zero. Standard suits most entered decimal data.

Enter integers, decimals, or scientific notation. Display precision does not round intermediate calculations.

Put rows on separate lines and separate entries with spaces, commas, or tabs. A valid 1×1 through 8×8 paste changes the grid dimensions.

Rank and Nullity

rank(A)
nullity(A)
Matrix dimensions
Rank–nullity check
Pivot columns
Free columns
Enter a valid matrix to calculate its rank, nullity, and fundamental-subspace bases.

Advertisement

RREF and Fundamental-Subspace Bases

Reduced row echelon form

Nonzero rows form the displayed row-space basis.

Calculate a matrix to display RREF.

Null-space basis

Vectors x satisfying Ax = 0.

Null-space basis vectors will appear here.

Column-space basis

Original columns corresponding to RREF pivots.

Column-space basis vectors will appear here.

Row-space basis

Nonzero rows of RREF.

Row-space basis vectors will appear here.

Rank–Nullity Formula and Meaning

Rank

rank(A) = number of pivots

Rank is the dimension of both the column space and the row space.

Nullity

nullity(A) = number of free columns

Nullity is the dimension of the solution space of the homogeneous system Ax = 0.

Rank–nullity theorem

rank(A) + nullity(A) = n

For an m × n matrix, the sum equals n, the number of columns—not generally the number of rows.

Numerical method: The calculator uses Gauss–Jordan elimination with partial pivoting and JavaScript double-precision arithmetic. The selected tolerance compares candidate pivots with the largest entered magnitude. Results are numerical estimates for decimal data; use exact-arithmetic software when exact symbolic rank is required.

How to Use the Matrix Rank and Nullity Calculator

  1. Select the matrix's row and column counts, then enter every value or paste a complete rectangular matrix.
  2. Choose a relative pivot tolerance. The standard setting is appropriate for most ordinary decimal inputs.
  3. Select Calculate rank and nullity.
  4. Review the rank–nullity identity, RREF, pivot and free columns, and bases. Column numbers are counted from 1.

Worked 3×4 Example

The default matrix has columns c₂ = 2c₁ and c₄ = c₁ − c₃, so only two columns are independent.

Matrix

A = [[1,2,1,0], [2,4,0,2], [3,6,1,2]]

RREF

[[1,2,0,1], [0,0,1,−1], [0,0,0,0]]

Result

rank(A) = 2, nullity(A) = 2

Columns 1 and 3 are pivots. Columns 2 and 4 are free, producing the null-space basis vectors (−2, 1, 0, 0) and (−1, 0, 1, 1).

How to Interpret Rank and Nullity

A matrix has full column rank when its rank equals its number of columns; then its nullity is zero and Ax = 0 has only the zero solution. It has full row rank when its rank equals its number of rows. A matrix can have both only when it is square and nonsingular.

Pivot columns from the original matrix form a column-space basis. Nonzero rows of RREF form a convenient row-space basis. One null-space basis vector is constructed for each free variable.

Matrix Rank and Nullity FAQs

What is matrix rank?

Rank counts independent columns, independent rows, or pivots—these three counts are always equal. Rank cannot exceed the smaller of the row and column counts.

What is matrix nullity?

Nullity is the number of independent directions sent to zero by the matrix. It equals the number of free variables in Ax = 0.

Does rank plus nullity equal rows or columns?

It equals the number of columns. An m × n matrix maps vectors from Rⁿ, and rank plus nullity equals the dimension n of that domain.

Can this calculator handle rectangular matrices?

Yes. It accepts any rectangular size from 1×1 through 8×8, including wide matrices that must have positive nullity and tall matrices that may have full column rank.

Why does the column-space basis use the original matrix?

Row operations preserve row relations but generally change the column space. RREF identifies which column positions are pivots; the basis vectors must then be taken from those positions in the original matrix.

Why can changing tolerance change rank?

Numerical rank depends on what counts as indistinguishable from zero. A looser tolerance treats more small pivots as zero; exact-zero mode accepts every nonzero floating-point pivot and can magnify roundoff.

Are my matrix entries private?

Yes. The page calculates, copies, and creates downloads locally. Its calculator code does not transmit or save entered matrix values.

Calculation Notes

Last reviewed: August 5, 2026 by the Starlight Tools editorial team.

All displayed bases correspond to the numerical pivot decisions made at the selected tolerance. The residual shown in copied and downloaded results is the largest absolute entry of Av across the computed null-space basis vectors.

Explore more tools