Matrix Rank Calculator
Gaussian elimination, row echelon form and nullityEnter any real matrix and let the calculator compute its rank using numerical Gaussian elimination. The tool produces a reduced row echelon form, identifies pivot columns, and classifies the matrix (full rank, singular, full row or column rank).
Designed for linear algebra students, instructors and practitioners who want a transparent and didactic view of matrix rank, not just the final number.
1. Define matrix size and entries
From 1 to 8.
From 1 to 8.
Change m and n, then click to resize the grid. Empty cells are treated as zero.
Use decimal notation. For integer matrices the algorithm behaves almost exactly like hand Gaussian elimination.
2. Rank, nullity and classification
The algorithm computes the rank of A by counting pivot rows after transforming the matrix into reduced row echelon form. It also reports nullity and whether the matrix has full row or column rank.
3. Reduced row echelon form (RREF)
The reduced row echelon form makes pivot positions and linear dependencies explicit. Non zero rows correspond to independent rows of A.
Values smaller than a numerical tolerance (currently 1e−10 in absolute value) are displayed as zero.
Rank of a matrix: definition and intuition
In linear algebra, the rank of an \(m \times n\) matrix \(A\) is defined as the dimension of its row space or, equivalently, the dimension of its column space. Intuitively, it tells you how many rows or columns carry independent information.
The rank satisfies \(0 \le \operatorname{rank}(A) \le \min(m,n)\). When \(\operatorname{rank}(A) = \min(m,n)\) we say that \(A\) has full rank.
Rank and solutions of linear systems
Given a linear system \(A x = b\), the rank of the coefficient matrix \(A\) and the rank of the augmented matrix \([A | b]\) determine the structure of the solution set:
- If \(\operatorname{rank}(A) = \operatorname{rank}([A|b]) = n\), the system has a unique solution.
- If \(\operatorname{rank}(A) = \operatorname{rank}([A|b]) < n\), the system has infinitely many solutions.
- If \(\operatorname{rank}(A) \ne \operatorname{rank}([A|b])\), the system is inconsistent (no solutions).
The calculator computes only \(\operatorname{rank}(A)\), but you can reason about these cases by extending the matrix with a column \(b\) and recomputing.
How the calculator computes rank (Gaussian elimination)
The rank is computed by transforming \(A\) into a row equivalent matrix in row echelon form and then counting the number of non zero rows. The steps replicated by the algorithm are:
- Search for a pivot (a non zero entry) in each column, starting from the top left.
- Swap rows if necessary so that the pivot moves to the current row.
- Normalize the pivot row so that the pivot becomes 1.
- Eliminate the entries below the pivot using row operations.
- Repeat for the next column and row until there are no more pivots.
In a second pass, the calculator also eliminates entries above each pivot to produce the reduced row echelon form (RREF).
Rank, nullity and the rank–nullity theorem
For an \(m \times n\) matrix \(A\), the nullity of \(A\) is the dimension of the solution space of the homogeneous system \(A x = 0\). The rank–nullity theorem states that
This calculator reports both \(\operatorname{rank}(A)\) and \(\operatorname{nullity}(A) = n - \operatorname{rank}(A)\). A nullity of zero means that the only solution of \(A x = 0\) is the trivial one, so the columns are linearly independent.
FAQ: understanding matrix rank
1. Why can rank be computed from rows or columns?
Row operations do not change the row space dimension, and every row operation can be expressed as multiplication by an invertible matrix on the left. This implies that the dimension of the row space equals the dimension of the column space, so row rank equals column rank.
2. What does it mean for a square matrix to be singular?
A square matrix \(A\) is singular when its rank is less than its size. For an \(n \times n\) matrix, this means \(\operatorname{rank}(A) < n\). In this case \(A\) is not invertible, its determinant is zero, and the linear system \(A x = b\) is either inconsistent or has infinitely many solutions.
3. Can two different matrices have the same rank?
Yes. Rank is only one invariant of a matrix and does not fully describe it. Many matrices can share the same rank but represent different linear transformations. However, matrices with the same rank and size have isomorphic row and column spaces.