Rank of a Matrix

The rank of a matrix counts its pivot columns, telling you the dimension of its column space and whether a system has a solution.

rank(A)=number of pivot columns\operatorname{rank}(A) = \text{number of pivot columns}

Solve a problem with Rank of a Matrix

Type the problem. The solver will use Rank of a Matrix where Rank of a Matrix is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Rank of a Matrix takes
AA
Rank of a Matrix
SymbolMeaning
AAThe matrix is the rectangular array of numbers for which you are computing the rank; it must be fully specified before you can count pivot columns.

When to use it

Use rank when you need to determine how many independent equations you have or whether a system of linear equations has a solution.

Level

Usually taught in: Linear Algebra

Worked examples

1. Find the rank of a matrix requiring row reduction

Problem

Find the rank of A=(123246012)A = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 0 & 1 & 2 \end{pmatrix}.
  1. A=(123246012)A = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 0 & 1 & 2 \end{pmatrix}

    Start with the given matrix and perform row reduction to identify pivot columns.

  2. (123000012)\begin{pmatrix} 1 & 2 & 3 \\ 0 & 0 & 0 \\ 0 & 1 & 2 \end{pmatrix}

    Eliminate below the first pivot using R2R22R1R_2 \to R_2 - 2R_1.

  3. (123012000)\begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & 2 \\ 0 & 0 & 0 \end{pmatrix}

    Swap rows to put a non-zero entry in position (2,2) using R2R3R_2 \leftrightarrow R_3.

  4. Pivots in columns 1 and 2\text{Pivots in columns } 1 \text{ and } 2

    The matrix is now in row echelon form with pivot entries in positions (1,1) and (2,2).

  5. rank(A)=2\operatorname{rank}(A) = 2

    Count the pivots: 2 pivot columns.

Answer: rank(A)=2\operatorname{rank}(A) = 2

Row reduction reveals that only two columns have pivot positions, corresponding to two linearly independent rows. The third row becomes zero, indicating linear dependence. Thus the rank is 2.

2. Find the rank of a matrix with negative entries and dependent rows

Problem

Find the rank of B=(246123369)B = \begin{pmatrix} -2 & 4 & -6 \\ 1 & -2 & 3 \\ 3 & -6 & 9 \end{pmatrix}.
  1. B=(246123369)B = \begin{pmatrix} -2 & 4 & -6 \\ 1 & -2 & 3 \\ 3 & -6 & 9 \end{pmatrix}

    Begin with the given matrix containing negative entries.

  2. (123123369)\begin{pmatrix} 1 & -2 & 3 \\ 1 & -2 & 3 \\ 3 & -6 & 9 \end{pmatrix}

    Scale row 1 to create a leading 1 using R112R1R_1 \to -\frac{1}{2}R_1.

  3. (123000000)\begin{pmatrix} 1 & -2 & 3 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}

    Eliminate below the first pivot using R2R2R1R_2 \to R_2 - R_1 and R3R33R1R_3 \to R_3 - 3R_1.

  4. Pivot in column 1\text{Pivot in column } 1

    Row echelon form is complete with only one pivot position in column 1.

  5. rank(B)=1\operatorname{rank}(B) = 1

    Count the pivot columns.

Answer: rank(B)=1\operatorname{rank}(B) = 1

All three rows are multiples of each other (rows 2 and 3 are multiples of row 1). After row reduction, only the first row survives as non-zero, giving rank 1. This indicates the three vectors are linearly dependent.

3. Find the rank of a coefficient matrix in a construction scheduling problem

Problem

A construction company assigns two crews to paint different sections of a building. Let h1h_1 be the hours crew A works and h2h_2 be the hours crew B works. The painting requirements give two constraints: Crew A working 4 hours and Crew B working 6 hours completes section 1 (4h1+6h2=304h_1 + 6h_2 = 30), and the same crews complete section 2 by working 2 hours and 3 hours respectively (2h1+3h2=152h_1 + 3h_2 = 15). Find the rank of the coefficient matrix of this system.
  1. C=(4623)C = \begin{pmatrix} 4 & 6 \\ 2 & 3 \end{pmatrix}

    Write the coefficient matrix from the system of equations.

  2. (13223)\begin{pmatrix} 1 & \frac{3}{2} \\ 2 & 3 \end{pmatrix}

    Create a leading 1 in position (1,1) using R114R1R_1 \to \frac{1}{4}R_1.

  3. (13200)\begin{pmatrix} 1 & \frac{3}{2} \\ 0 & 0 \end{pmatrix}

    Eliminate below the first pivot using R2R22R1R_2 \to R_2 - 2R_1.

  4. Number of non-zero rows: 1\text{Number of non-zero rows: } 1

    The second row becomes all zeros, indicating the equations are dependent.

  5. rank(C)=1\operatorname{rank}(C) = 1

    Count pivot columns: only column 1 has a pivot.

Answer: rank(C)=1\operatorname{rank}(C) = 1

The rank is 1, meaning the two equations are not independent. The second equation is exactly half of the first, so there is only one independent constraint on the two variables. This suggests the crews have infinitely many valid schedules that satisfy both painting requirements.

Common mistakes

Where Rank of a Matrix usually goes wrong
Answer came out wrong
A student says the rank of (1200)\begin{pmatrix} 1 & 2 \\ 0 & 0 \end{pmatrix} is the total number of non-zero entries (three ones), not the number of pivot columns.
Count only the columns containing a leading entry in row echelon form. This matrix has one pivot in column 1, so rank = 1.
Confusing rank with the number of rows. A student sees a 3×53 \times 5 matrix and incorrectly concludes rank = 3 because there are 3 rows.
Always row reduce the matrix first to find pivot columns. The rank is the count of those pivots, which could be 0, 1, 2, or 3 for a 3×53 \times 5 matrix.
A student solves the system Ax=0Ax = 0 and finds 2 free variables, then concludes rank = 2.
If there are 2 free variables and the matrix has 5 columns, then rank = 5 - 2 = 3. Count pivot columns, not free variables.
The mistakeWhy it is wrongThe fix
A student says the rank of (1200)\begin{pmatrix} 1 & 2 \\ 0 & 0 \end{pmatrix} is the total number of non-zero entries (three ones), not the number of pivot columns.Rank counts columns with pivots, not individual non-zero elements. A column can have many non-zero entries but be non-pivot if its leading entry is not in the correct row.Count only the columns containing a leading entry in row echelon form. This matrix has one pivot in column 1, so rank = 1.
Confusing rank with the number of rows. A student sees a 3×53 \times 5 matrix and incorrectly concludes rank = 3 because there are 3 rows.The rank cannot exceed the minimum of the number of rows and columns. A 3×53 \times 5 matrix can have rank at most 3, but the actual rank depends on how many columns contain pivots, which requires row reduction.Always row reduce the matrix first to find pivot columns. The rank is the count of those pivots, which could be 0, 1, 2, or 3 for a 3×53 \times 5 matrix.
A student solves the system Ax=0Ax = 0 and finds 2 free variables, then concludes rank = 2.The number of free variables is nrank(A)n - \operatorname{rank}(A), not the rank itself. Free variables come from non-pivot columns, not pivot columns.If there are 2 free variables and the matrix has 5 columns, then rank = 5 - 2 = 3. Count pivot columns, not free variables.

Tips and when to use something else

  • Always row reduce to row echelon form before counting pivots—the rank is not visible from the original matrix without this step.
  • The rank of an m×nm \times n matrix satisfies 0rank(A)min(m,n)0 \leq \operatorname{rank}(A) \leq \min(m, n). If you get a rank larger than this, you've made an error.
  • For systems of equations, if rank(A)=rank([Ab])\operatorname{rank}(A) = \operatorname{rank}([A | b]) (the coefficient matrix and augmented matrix have the same rank), the system is consistent.
  • If you're counting the non-pivot columns (free variables), use rank to find the number: (number of free variables) = nrank(A)n - \operatorname{rank}(A), not the rank itself.

Frequently asked questions

Can rank be zero?
Yes, the rank is zero only for the zero matrix (all entries are 0). Every non-zero matrix has at least rank 1.
Is rank the same as determinant?
No. Rank counts pivot columns (always between 0 and min(m,n)\min(m,n)), while determinant is a single number (only defined for square matrices) measuring whether the matrix is invertible. They are related: a square matrix is invertible if and only if its rank equals its size.
How is rank used in solving systems of equations?
Rank determines consistency and uniqueness. If rank(A)=(A) = rank([Ab])=n([A|b]) = n (number of columns), the system has a unique solution. If the ranks are equal but less than nn, there are infinitely many solutions. If rank(A)<(A) < rank([Ab])([A|b]), the system has no solution.
Why do we care about the number of non-zero rows?
In row echelon form, the number of non-zero rows always equals the number of pivot columns, so counting non-zero rows is a quick way to find rank without identifying each pivot explicitly. However, be careful: this is only true after row reduction, not in the original matrix.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18