What this calculator does
The rank of a matrix is the number of linearly independent rows (or equivalently columns) it has. This matrix rank calculator works it out by row reduction: it eliminates rows, one pivot column at a time, until whatever is left is either an independent row or all zeros, and counts the rows that survive.
Rank answers a question the other matrix tools on this site do not. A determinant tells you whether a square matrix is invertible; trace and transpose describe its diagonal and its mirror image; but none of them count how many of the rows actually carry distinct information. A matrix with proportional rows, such as [1, 2] and [2, 4], is rank 1 even though it has two rows, because the second row is just a multiple of the first and adds nothing new.
The formula
The calculator performs Gaussian elimination: it picks the largest available entry in each column as a pivot, uses it to zero out that column in every other row, and moves on to the next column. Rows that become entirely zero (within a small numerical tolerance, to avoid floating-point rounding being mistaken for a genuine dependency) do not count. The rank is the number of non-zero pivot rows left at the end.
| Term | Meaning |
|---|---|
| Rank | The number of linearly independent rows in a matrix, found after row-reducing it to echelon form. |
| Linearly independent | A row that cannot be written as a combination of the other rows; it adds genuinely new information rather than repeating it in a different scale. |
| Full rank | A matrix whose rank equals the smaller of its row and column counts, meaning no row (or column) is redundant. |
The inputs explained
| Field | What to enter |
|---|---|
| Matrix rows (semicolon between rows, comma between entries) | Enter each row as comma-separated numbers, with a semicolon between rows, for example 1, 2, 3; 4, 5, 6; 7, 8, 9. Between 2 and 4 rows are supported, and every row must have the same number of entries. |
When to use it
Checking whether a system of equations has a unique solution
A system of linear equations has a unique solution only if the coefficient matrix has full rank. A rank lower than the number of unknowns means the equations are redundant or contradictory, before even attempting to solve them.
Confirming a matrix is invertible
A square matrix is invertible only if it has full rank, which is another way of saying its determinant is non-zero. Rank and determinant agree on this, but rank also works usefully on non-square matrices where determinant does not apply at all.
Spotting redundant data in a dataset
When rows represent measurements or features, a rank lower than the row count means one or more rows are exact linear combinations of the others, which is a sign of duplicated or derived data worth investigating before further analysis.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How rank behaves for a few common 3×3 patterns
Three matrices that illustrate full rank, a repeated-row dependency, and a classic singular case.
| Matrix | Rank | Full rank? |
|---|---|---|
| 1,0,0 / 0,1,0 / 0,0,1 | 3 | Yes: rank equals the smaller dimension (3) |
| 1,2,3 / 2,4,6 / 5,1,9 | 2 | No: rank is less than the smaller dimension (3), so the rows are linearly dependent |
| 1,2,3 / 4,5,6 / 7,8,9 | 2 | No: rank is less than the smaller dimension (3), so the rows are linearly dependent |
Questions
What does it mean if the rank is less than the number of rows?
It means at least one row can be written as a combination of the others, so it carries no independent information. The matrix is called rank-deficient, and in the context of a linear system it usually signals either infinitely many solutions or no solution at all, depending on the right-hand side.
How does rank relate to the determinant?
For a square matrix, full rank and a non-zero determinant are exactly the same condition. A matrix with a zero determinant is singular and has rank strictly less than its size. Rank is the more general concept because it also applies to matrices that are not square, where a determinant does not exist.
Why does the calculator use a numerical tolerance?
Floating-point arithmetic can leave a value like 0.0000000001 where an exact zero was intended, purely from rounding during elimination. Treating anything below a small tolerance as zero avoids the calculator reporting a slightly-too-high rank because of that rounding noise.
Can a non-square matrix have full rank?
Yes. Full rank for a non-square matrix means its rank equals the smaller of its row and column counts. A 2×3 matrix is full rank if its rank is 2, since 2 is the smaller dimension, even though it is not a square matrix and has no determinant.
For a matrix’s determinant, trace or transpose instead of its rank, see the matrix determinant calculator or the matrix trace and transpose calculator.