Matrix Rank Calculator
Find the rank of any matrix up to 10x10, square or rectangular. Get the rank, the nullity from the rank-nullity theorem, and which columns hold pivots.
Matrix Rank Calculator
Background.
The rank of a matrix is the number of genuinely independent rows it has — how much real information is in it, once you strip out every row that is just a combination of the others. This calculator takes any real matrix up to 10 by 10, square or rectangular, and returns its rank, its nullity, and exactly which columns held a pivot during elimination.
Type or paste your matrix with one row per line. Entries can be separated by commas or spaces, rows by line breaks or semicolons, and the bracketed form [[1,2],[3,4]] is accepted too. Unlike a determinant, rank is defined for any shape, so a 3 by 5 matrix is perfectly fine here.
The rank answers three questions at once, and they turn out to be the same question. It is the number of linearly independent rows. It is also the number of linearly independent columns — a genuinely surprising theorem, since there is no obvious reason those two counts should match. And it is the largest size of a square submatrix whose determinant is not zero. The Encyclopedia of Mathematics gives all three characterisations, and this calculator computes the first while the worked example checks it against the third.
The companion number is the nullity: the dimension of the null space, meaning how many independent solutions the equation Ax = 0 has beyond the trivial all-zeros one. The rank-nullity theorem ties them together with a single line — rank plus nullity equals the number of columns — which is why a rank-deficient system has infinitely many solutions rather than exactly one. In the language of elimination, the rank counts the pivot variables and the nullity counts the free variables.
The verdict beside the answer uses LAPACK's vocabulary. Full rank means the rank has hit min(rows, columns), the largest value it could possibly take for a matrix of that shape. For a square matrix, full rank is exactly the same statement as non-singular: the determinant is not zero, the inverse exists, and Ax = b has one unique solution. For a rectangular matrix, full rank still means the most independence the shape allows, but the consequences differ — a tall full-rank matrix gives a least-squares problem a unique answer, while a wide one gives Ax = b infinitely many solutions.
One limit belongs right next to the number rather than buried in an FAQ. Deciding rank means deciding when a pivot is zero, and for numbers with decimals that is a judgement call rather than a fact. This calculator treats a pivot candidate as zero when its absolute value is at or below 1e-10 times the largest absolute entry of the matrix you entered. The test is relative, so multiplying your whole matrix by a million cannot change the answer. For an integer matrix the threshold never comes into play at all, because the arithmetic runs at 60 significant digits and a genuine zero comes out as an exact zero. But if your data is measured rather than exact, be aware that the rank of a near-dependent matrix is a modelling decision, not an observation — professional numerical software makes the same decision using the singular values instead of the pivots, and can disagree at the margin.
What this page deliberately does not print is the row-echelon form itself, even though it computes one on the way. That is the deliverable of a separate calculator, and duplicating it here would add nothing for someone who came asking about rank.
What is matrix rank calculator?
The rank of an m x n matrix A is the dimension of the space spanned by its rows, which is always equal to the dimension of the space spanned by its columns. Equivalently, it is the largest k for which A has a k x k submatrix with a non-zero determinant — the maximal order of a non-zero minor. Rank is bounded above by min(m, n): a matrix that attains that bound has full rank, and one that does not is rank deficient. The nullity is the dimension of the null space N(A) = {x : Ax = 0}, and the rank-nullity theorem states that rank + nullity = n, the number of columns. In elimination terms, reducing A to row-echelon form produces one pivot per independent row; the number of pivots is the rank, the columns holding those pivots are the pivot columns (and form a basis for the column space), and every other column corresponds to a free variable in Ax = 0. Rank is unchanged by any elementary row or column operation, by transposition, and by multiplication by an invertible matrix — which is why elimination is a valid way to compute it.
How to use this calculator.
- Type your matrix into the box, one row per line, with entries separated by commas or spaces. The matrix does not need to be square.
- You can also paste [[1,2,3],[4,5,6]] or use semicolons as row separators — both are parsed.
- Read the headline number: that is the rank, the count of linearly independent rows.
- Read the nullity to know how many free variables Ax = 0 has. Rank plus nullity always equals the number of columns.
- Check the full rank / rank deficient verdict. For a square matrix, full rank and non-singular mean the same thing.
- Read the pivot column list to see which columns carried the independence — those columns form a basis for the column space of A.
- If your entries are measured rather than exact, remember the zero threshold: a pivot at or below 1e-10 times your largest entry is counted as zero.
The formula.
Rank is computed by Gaussian elimination with partial pivoting, walking the columns from left to right while advancing the pivot row only when a pivot is actually found — which is what lets the same loop handle rectangular and rank-deficient matrices without a special case. For each column, the algorithm looks at every row at or below the current pivot row, picks the entry with the largest absolute value, and if that value is above the zero threshold it swaps that row up, eliminates the column from every row below it, records the column as a pivot column, and moves the pivot row down one. If the largest candidate is at or below the threshold, the whole column is treated as zero below the pivot row, so it becomes a free column and the pivot row is not consumed. The rank is the number of pivot columns recorded; the nullity is the number of columns minus the rank, which is the rank-nullity theorem read straight off the algorithm. On the worked example A = [[1,2,3,4],[2,4,6,8],[1,3,5,7]], pivoting swaps the row starting with 2 to the top, subtracting half of it from each remaining row zeroes the first column and turns the old first row into [0,0,0,0] because it was exactly half of the row above; the third row becomes [0,1,2,3], which supplies the second pivot; and nothing is left for columns 3 and 4. Two pivots, in columns 1 and 2, so rank = 2, and nullity = 4 - 2 = 2. All arithmetic runs at 60 significant digits with no intermediate rounding, and the zero threshold is 1e-10 times the largest absolute entry of the matrix as entered, making the test relative rather than absolute.
A worked example.
Take the 3 by 4 matrix A = [[1,2,3,4],[2,4,6,8],[1,3,5,7]]. The second row is exactly twice the first, so it carries no information the first row did not already carry — at most two of the three rows can be independent. Elimination confirms it: partial pivoting moves the row beginning with 2 to the top, subtracting half of it from the old first row leaves [0,0,0,0], and subtracting half of it from the third row leaves [0,1,2,3], which supplies a second pivot in column 2. Columns 3 and 4 have nothing left below, so the process stops with two pivots, in columns 1 and 2. The rank output is therefore 2, and the pivot columns output reads 1, 2. Because min(rows, columns) = min(3, 4) = 3 and the rank is only 2, the verdict is rank deficient, with 1 row that is a linear combination of the others. The nullity is columns minus rank = 4 - 2 = 2, meaning Ax = 0 has a two-dimensional space of solutions and the system has two free variables. As an independent check against a different definition of rank entirely — the maximal order of a non-zero minor — every 3 by 3 submatrix of A contains both the first and second rows or their proportional images, so all of them have determinant zero; but the 2 by 2 minor on rows 1 and 3 and columns 1 and 2 is det[[1,2],[1,3]] = 3 - 2 = 1, which is not zero. Maximal order of a non-zero minor = 2, matching the rank the elimination found.
Frequently asked questions.
What does the rank of a matrix actually tell you?
Is the row rank always equal to the column rank?
What is the rank-nullity theorem?
What does full rank mean?
Can a rectangular matrix have a rank?
How do you find rank by hand?
Why does the answer depend on a zero tolerance?
References& sources.
- [1]Encyclopedia of Mathematics (EMS Press), 'Rank'. Defines the rank as the rank of the system of rows (row rank) or of columns (column rank), and states that it 'is also equal to the maximal order of a non-zero minor'. Retrieved 2026-07-29.
- [2]LAPACK Users' Guide, 3rd ed. (SIAM, 1999), section 2.3 'Linear Least Squares Problems'. Source for the full-rank vocabulary used here: rank(A) = min(m,n) means A has full rank, while rank(A) < min(m,n) is the rank-deficient case. Retrieved 2026-07-29.
- [3]MIT OpenCourseWare 18.06 Linear Algebra (Spring 2010), Prof. Gilbert Strang — syllabus goals: 'Complete solution to Ax = b (column space containing b, rank of A, nullspace of A and special solutions to Ax = 0 from row reduced R)'. Retrieved 2026-07-29.
- [4]Golub, G. H. & Van Loan, C. F. (2013). Matrix Computations, 4th ed., Johns Hopkins University Press — sections 2.4 and 5.5, on rank, the SVD, and why determining numerical rank requires a declared tolerance. Print reference; publisher page linked.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled