Matrix Rank Calculator

Find matrix rank with Gaussian elimination and identify the number of linearly independent rows or columns.

Calculate matrix rank
Enter any rectangular matrix to determine its rank instantly.

Separate columns with commas and rows with semicolons.

About matrix rank

The rank of a matrix is the number of linearly independent rows or columns it contains. Although row rank and column rank are defined from different directions, a fundamental theorem of linear algebra proves that they are always equal. Rank therefore gives one compact number describing how much independent information a matrix carries. A matrix has full rank when its rank equals the smaller of its row count and column count. A square full-rank matrix is invertible, has a nonzero determinant, and maps distinct input vectors to distinct output vectors. A rank-deficient matrix contains redundancy: at least one row or column can be formed from combinations of others. For example, if every row is a multiple of the first row, the matrix has rank one unless every entry is zero. This calculator determines rank through Gaussian elimination with partial pivot selection. It searches each column for a reliable nonzero pivot, swaps that row into position, scales the pivot row, and removes that column from the other rows. Each successful pivot adds one to the rank. Columns without a usable pivot are skipped because they do not introduce an independent direction. A small numerical tolerance prevents floating-point roundoff from turning theoretical zeros into false pivots. Rank connects directly to systems of linear equations. For a coefficient matrix, it counts the number of independent constraints. Comparing the rank of a coefficient matrix with the rank of its augmented matrix reveals whether a system has no solution, one solution, or infinitely many solutions. The rank-nullity theorem also states that the number of columns equals rank plus nullity, linking the image of a transformation to its kernel. In data analysis, rank detects redundant features and underlies dimensionality reduction. In control theory it appears in controllability and observability tests. In geometry it gives the dimension of the space spanned by a collection of vectors. Enter rectangular or square matrices using decimal or integer values. The displayed integer is bounded between zero and the smaller matrix dimension, making the result easy to interpret and verify.

Matrix rank examples

See how independence changes rank.

MatrixRankExplanation
[[1,2],[3,4]]2Both rows are independent, so this square matrix has full rank.
[[1,2,3],[2,4,6],[3,6,9]]1Every row is a multiple of the first.
[[1,0,0],[0,1,0]]2The rectangular matrix has two independent rows.

How to calculate matrix rank

  1. Enter every row of the matrix, using commas between entries.
  2. Separate consecutive rows with semicolons.
  3. Click Calculate Rank to perform row reduction.
  4. Read the number of independent rows or columns.

Frequently asked questions

What does matrix rank represent?

Rank counts independent rows or columns in a matrix. It also gives the dimension of the transformation's output space.

What is full rank?

A matrix is full rank when rank equals its smaller dimension. For a square matrix, full rank also means the matrix is invertible.

Can a rectangular matrix have rank?

Yes, rank is defined for every rectangular matrix. Its maximum is the smaller of the row and column counts.

What is the rank of a zero matrix?

A zero matrix has rank zero because it contains no independent nonzero rows or columns. It maps every vector to the zero vector.

How is rank calculated?

Gaussian elimination reduces the matrix and counts pivot positions. Each pivot identifies one independent direction.