Formula and Method for Matrix Rank
The rank of a matrix is the dimension of the vector space spanned by its rows (equivalently, by its columns) — it measures how many of those rows or columns are truly independent of one another. This calculator reduces your matrix to row echelon form using Gaussian elimination and counts the resulting pivot rows to determine the rank, then derives the nullity and full-rank status from that number.
How the calculation works
Enter the number of rows and columns (up to 5×5) and type the matrix, one row per line, with entries separated by spaces or commas. The calculator performs Gaussian elimination with partial pivoting: for each column it selects the largest available entry as the pivot, swaps it into position, and eliminates every entry below it using row operations. The count of nonzero pivot rows once elimination finishes is the rank. Because of the rank-nullity theorem, rank(A) + nullity(A) = number of columns, so nullity = columns − rank. If rank equals min(rows, columns), the matrix has full rank; for a square matrix this also means it is invertible with a nonzero determinant.
Common mistakes
- Wrong entry count: each row must contain exactly as many numbers as the selected column count, and the textarea must contain exactly as many rows as selected — extra or missing entries will be rejected.
- Assuming rank always equals matrix size: an n×n matrix can have any rank from 0 up to n; rank equals n only when every row (and column) is linearly independent.
- Confusing rank with determinant: the determinant is defined only for square matrices and is zero exactly when a square matrix is not full rank, but rank itself is defined for any m×n matrix, square or not.
Real-world applications
- Rank determines whether a system of linear equations Ax = b has a unique solution, infinitely many solutions, or none, by comparing rank(A) to the rank of the augmented matrix.
- In data science and statistics, a rank-deficient data matrix signals redundancy — some columns are linear combinations of others, which affects regression and dimensionality-reduction methods.
- Rank is used in control theory (controllability and observability matrices), image and signal compression (low-rank approximation), and computing the degrees of freedom in linear models.