Matrix Rank Calculator
Compute the rank of any m×n matrix by reducing it to row-echelon form and counting the nonzero pivots.
Rank-deficient matrix
How does this calculator work?
The matrix rank counts the linearly independent rows (or columns). This tool applies Gaussian elimination with partial pivoting, reduces the matrix to row-echelon form, and counts the nonzero pivots. Rank equals that count and is at most min(rows, columns); when it reaches that maximum the matrix is full rank, otherwise rank-deficient.
Formula
How this is calculated
Enter matrix A with one row per line, separating each entry by a space or comma. Every row must have the same number of columns, and all entries must be valid numbers. The calculator parses the text into an m×n grid of real numbers.
The rank is found with Gaussian elimination. Working column by column, the algorithm selects the entry of largest absolute value as the pivot (partial pivoting for numerical stability), swaps that row up, and eliminates every entry below the pivot. A column contributes a pivot only when its candidate value exceeds a small tolerance (1e-9); values smaller than this are treated as zero to absorb floating-point round-off. The rank equals the number of pivot rows produced.
The rank can never exceed min(m, n). When rank equals min(m, n) the matrix has full rank (rows or columns are linearly independent); otherwise it is rank-deficient, and the deficiency min(m, n) − rank counts the dependent directions. Because comparisons use a fixed tolerance, near-singular matrices with very small but nonzero entries may report a slightly lower rank — scale your data sensibly if exact results matter.
Frequently asked questions
The rank is the number of linearly independent rows (equivalently columns). It measures how much unique information the matrix carries and equals the dimension of its column space.
A matrix has full rank when its rank equals min(m, n). For a square matrix this means it is invertible (nonzero determinant); for a rectangular matrix it means all rows or all columns are independent.
Gaussian elimination uses floating-point arithmetic with a tolerance of 1e-9 to decide whether a pivot is zero. For ill-conditioned or poorly scaled matrices, round-off can push a tiny pivot below the tolerance, lowering the reported rank.
Also known as
TG we-Calculate Editorial Team. (2026). Matrix Rank Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/matrix-rank-calculator
TG we-Calculate Editorial Team. "Matrix Rank Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/matrix-rank-calculator.
TG we-Calculate Editorial Team, "Matrix Rank Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/matrix-rank-calculator
@misc{wecalculate_matrix_rank_calculator, title = {Matrix Rank Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/matrix-rank-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
