Matrix Rank Calculator

Find the rank of a matrix by row reduction, with pivot columns and nullity.

Math and PercentUpdated 2026-11-192 min read
Matrix Rank Calculator
Up to 6 rows and 6 columns. Separate entries with spaces or commas, and rows with semicolons, for example 1 2; 3 4.
Rank
...
Shape...
Full rank status...
Nullity...
Pivot columns...

What it does

The rank of a matrix tells you how many of its rows or columns carry new information. If one row is just twice another, the second row adds nothing to the span, and the rank drops. Counting independent directions is the whole idea.

This tool accepts a rectangular matrix of up to six rows and six columns. Type entries separated by spaces or commas, and separate rows with semicolons. The default matrix has two rows and two columns and already shows a worked case.

The calculation uses Gaussian elimination. Row operations move the matrix to row echelon form without changing its row space, so the number of nonzero rows you end with is the rank. The pivot columns are reported as well, using one based numbering.

Rank connects several questions at once. A square matrix is invertible exactly when its rank equals its size. A system of equations has a unique solution only when the coefficient matrix reaches full rank. The nullity, shown here as columns minus rank, counts the free variables in a homogeneous system.

Because rank is an integer obtained from exact pivots, there is no rounding in the result. Tiny entries near zero are treated as zero so that floating point noise does not create a false pivot.

How to use

  1. Type the matrix rows, separating entries with spaces or commas.
  2. Put a semicolon between rows, for example 1 2; 3 4.
  3. Read the main result, which is the rank of the matrix.
  4. Check the shape to confirm the number of rows and columns the tool parsed.
  5. Look at the pivot columns to see which original columns carry the independent directions.
  6. Use the nullity to count free variables when solving a homogeneous system.

Formula

rank(A) = number of nonzero rows after Gaussian elimination to row echelon form; nullity = number of columns minus rank(A)
A
The input matrix, with m rows and n columns.
rank(A)
The number of linearly independent rows, equal to the number of independent columns.
nullity
n minus rank(A), the dimension of the null space.

Elementary row operations do not change the row space, so elimination preserves rank. In row echelon form the first nonzero entry of each surviving row is a pivot, and the number of pivots equals the rank. For a square matrix, full rank is the same as a nonzero determinant.

Worked example

Example: a 2 by 2 matrix

The page opens with the matrix 1 2; 3 4.

  1. Enter the two rows 1 2 and 3 4.
  2. The first pivot is the 1 in column 1. Subtract 3 times row 1 from row 2 to get 0 -2.
  3. The second pivot is -2 in column 2. Scale that row to 1.
  4. Both rows are nonzero, so the rank is 2.
  5. The matrix is 2 by 2, and the smaller dimension is 2, so the verdict is Full rank.
  6. Nullity is columns minus rank, which is 2 minus 2, or 0.
  7. The tool reports rank 2, shape 2 x 2, Full rank, and pivots 1, 2.

Reference table

Ranks of sample matrices
Matrix entriesShapeRankVerdict
1 2; 3 42 x 22Full rank
1 2; 2 42 x 21Rank deficient
1 2 3; 2 4 6; 0 1 13 x 32Rank deficient
1 0 0; 0 1 0; 0 0 13 x 33Full rank

Limits

  • Accepts at most 6 rows and at most 6 columns.
  • Entries must be numbers with absolute value at most 1,000,000.
  • Rows with different lengths are rejected instead of being padded with zeros.
  • Values within a tiny tolerance of zero are treated as zero pivots.

Common mistakes

  • Counting all rows instead of only the nonzero rows after elimination.
  • Assuming a square matrix is full rank just because it has no zero entries.
  • Mixing up rank and nullity when counting free variables.
  • Forgetting that row rank and column rank are always equal.
  • Typing rows with inconsistent numbers of entries.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is the rank of 1 2; 2 4?

1. The second row is twice the first, so one independent row survives elimination.

Rank of 1 2 3; 2 4 6; 0 1 1?

2. Row two is twice row one, while row three is independent, leaving two pivot rows.

Nullity of a 3 by 5 matrix with rank 2?

3. Nullity equals columns minus rank, so 5 minus 2 is 3.

Questions

What does rank mean in plain terms?

It is the number of rows or columns that are not combinations of the others.

Can rank be larger than the number of rows?

No. Rank is at most the smaller of the row count and column count.

How does rank tell me if a matrix is invertible?

A square matrix is invertible exactly when its rank equals its number of rows.

Why do row operations preserve rank?

They replace rows with combinations of rows without changing the row space, so the number of independent rows stays the same.

What is the nullity?

It is columns minus rank. It counts the free variables in the homogeneous equation A x equals zero.

Does the tool round the rank?

No. Rank is an integer, and only the pivot search uses a small zero tolerance.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.