The rank of a matrix is the number of linearly independent rows or columns it contains. In linear algebra, matrices are used to represent systems of linear equations and linear transformations. The rank tells you how many independent directions of information the matrix carries.
If the rank of an m by n matrix is equal to the smaller of m and n, the matrix is said to have full rank. Otherwise, it is rank-deficient, meaning that at least one row or column can be written as a linear combination of the others.
There are several equivalent ways to define the rank of a matrix A:
All of these numbers are equal, and that common value is the rank of A. In symbols, you will often see the notation rank(A) or rk(A).
The connection to the null space is captured by the Rank–Nullity Theorem. For a matrix A with n columns, we have:
Here, nullity(A) is the dimension of the null space of A, that is, the number of independent solutions to A x = 0.
This calculator accepts real-valued entries for a matrix up to size 3×3. You can use it for 2×2 or 3×3 matrices, and also for rectangular matrices such as 2×3 or 3×2, provided they fit within the 3×3 grid. Any empty fields you leave in the grid are treated as zeros.
The core of the computation is row reduction to row-echelon form. The algorithm:
Elementary row operations preserve the row space and the solution set of the associated system of linear equations. That is why they do not change the rank of the matrix.
The on-page grid always shows 3 rows and 3 columns, but you are not required to fill every box:
Interpreting blanks as zeros means that the calculator effectively works with a fixed 3×3 matrix whose unused entries are 0. For rank calculations this is equivalent to embedding your smaller matrix in a 3×3 matrix with extra zero rows or columns.
Suppose you have a 3×3 matrix A with entries aij:
A = [ [a11, a12, a13], [a21, a22, a23], [a31, a32, a33] ].
The calculator applies row operations such as:
These are the same steps you would follow by hand when solving a system of linear equations using Gaussian elimination. When the matrix is in row-echelon form (all nonzero rows above any all-zero rows, and each leading entry to the right of the one above it), the number of nonzero rows equals the rank.
The implementation uses floating-point arithmetic. To decide whether an entry is effectively zero, the code compares its absolute value to a small tolerance. If all entries in a row are smaller than this tolerance in absolute value, that row is treated as a zero row and does not contribute to the rank.
This approach is standard in numerical linear algebra and helps avoid treating tiny rounding errors as genuine pivots. However, it also means that rows made up of very small numbers (for example, 1×10−12) can be treated as zero in borderline cases. See the limitations section below for more guidance.
You can think of the columns of a matrix as vectors starting at the origin. All linear combinations of these column vectors form the column space. The rank of the matrix is precisely the dimension of this column space.
For small matrices, the geometric picture is intuitive:
Rank is also tied to the null space. If a matrix has rank 2 and 3 columns, then its nullity is 1. That means there is exactly one independent direction in which nonzero inputs are mapped to the zero vector. In practical terms, there is one free variable when solving A x = 0.
After you enter your matrix and run the calculation, the tool returns a single integer: the rank of the matrix. Here is how to interpret that number:
For a square coefficient matrix in a linear system A x = b:
Consider the 2×2 matrix
A = [ [1, 2], [3, 4] ].
In the calculator, you can enter:
Row reduction steps:
There are two pivot rows, so the rank is 2. Since this equals the size of the matrix, A is invertible and its columns are linearly independent.
Consider the 3×3 matrix
A = [ [1, 2, 3], [2, 4, 6], [1, 1, 1] ].
Notice that the second row is exactly 2 times the first row, so those two rows are not independent. In the calculator, enter:
Row reduction steps:
There are two nonzero rows in the echelon form, so the rank is 2. The matrix is not full rank. This tells you that:
Rank is closely connected to other familiar matrix properties. The table below summarizes some key relationships for square matrices.
| Concept | What it measures | Relation to rank |
|---|---|---|
| Determinant | A scalar summarizing volume scaling and orientation. | A square matrix has full rank if and only if its determinant is nonzero. |
| Invertibility | Whether there exists a matrix A−1 such that A A−1 = I. | A is invertible exactly when it has full rank (rank equals its size). |
| Null space | All vectors x with A x = 0. | The dimension of the null space is the number of columns minus the rank. |
| Linear independence | Whether a set of vectors contains no nontrivial linear relations. | The rank equals the maximal number of linearly independent rows or columns. |
| Solutions of A x = b | Consistency and number of solutions. | Rank helps determine whether the system has zero, one, or infinitely many solutions. |
This tool is designed as a quick, educational calculator for small matrices. Keep the following points in mind when interpreting the results:
As long as you are aware of these assumptions, the rank reported by the calculator is a reliable guide to linear independence and the structure of your system.