The rank of a matrix tells you how much independent information it actually holds — a concept that underlies whether a system of linear equations has a unique solution, infinitely many, or none at all. This calculator finds the rank of any matrix up to 5×5 (square or rectangular) by reducing it to row-echelon form via Gaussian elimination, the same method taught in an introductory linear algebra course.

How row-echelon reduction reveals the rank

Gaussian elimination works column by column. For each column, the calculator picks the row with the largest absolute value in that column (partial pivoting, which keeps the arithmetic numerically stable) and swaps it to the top of the remaining rows if needed. It then subtracts a multiple of that pivot row from every row below it, zeroing out the entries beneath the pivot. Repeating this for each column produces a staircase-shaped row-echelon form.

Once the matrix is in row-echelon form, the rank is just the number of rows that aren't entirely zero. Any row that became all zeros during elimination represents a row of the original matrix that was a linear combination of the others — it carried no new information.

Inputs and what they mean

Choose the number of rows and columns independently (1 to 5 each), then fill in the grid with any real numbers. The matrix does not need to be square — rectangular matrices are fully supported, and the calculator automatically caps the maximum possible rank at min(rows, columns). Use the preset buttons to load a full-rank example, a rank-deficient example with dependent rows, a non-square example, or the identity matrix.

Limits and edge cases

Rank is always a whole number between 0 (only for the all-zero matrix) and min(rows, columns). Floating-point arithmetic can leave tiny non-zero residues (like 1e-15) where a value should be exactly zero — the calculator treats anything smaller than a small tolerance as zero so these numerical artifacts don't inflate the rank. This calculator supports matrices up to 5×5; for full matrix inversion use the dedicated Matrix Inverse Calculator, and for solving a system of linear equations directly use the System of Equations Calculator.