Matrix Rank Calculator

Calculate the rank of a matrix online. Enter a square or rectangular matrix to find its rank, pivot columns, and row-echelon form using Gaussian elimination.

Calculate the Rank of a Matrix

Enter one row per line. Separate numbers with spaces or commas. The example below is ready to calculate.

Example: 1 2 3 on the first line, then 2 4 6 on the second. Every row must have the same number of entries.

Small values are treated as zero during elimination. Default: 0.00000001. For exact integer matrices, the default is usually suitable.

What Is the Rank of a Matrix?

The rank of a matrix is the maximum number of linearly independent rows or columns. Equivalently, it is the number of pivots in a row-echelon form of the matrix.

If a matrix has m rows and n columns, its rank cannot exceed the smaller of m and n:

rank(A) ≤ min(number of rows, number of columns)

A matrix has full rank when its rank equals that upper bound. For a square matrix, full rank means the matrix is invertible.

How to Calculate Matrix Rank

  1. Enter the matrix, with each row on a separate line.
  2. Choose a numerical tolerance appropriate for your values.
  3. Click Calculate Matrix Rank.
  4. Read the rank, pivot columns, and row-echelon form in the results.

Example

Consider the matrix:

1 2 3 2 4 6 1 1 1

The second row is twice the first row, so it does not provide an additional independent row. The third row is independent of the first, giving a rank of 2.

Related Matrix Calculators

Frequently Asked Questions

Can a rectangular matrix have a rank?

Yes. Matrix rank is defined for both square and rectangular matrices. It is at most the smaller of the number of rows and the number of columns.

What is the rank of a zero matrix?

A matrix whose entries are all zero has rank zero because it contains no nonzero pivots.

What does full rank mean?

A matrix has full rank when its rank equals the smaller of its row and column counts. For a square matrix, this is equivalent to having a nonzero determinant and an inverse.

Why does numerical tolerance matter?

Decimal calculations can contain rounding errors. The tolerance determines when a small value is treated as zero. A matrix with nearly dependent rows may produce different numerical ranks under different tolerances.

Does this calculator support negative and decimal numbers?

Yes. Enter negative values, decimals, or scientific notation, such as -2, 0.75, or 1e-5. Use the same number of entries in every row.