Matrix Calculator

🌐 English
A (3×3)
Rows: 3
Cols: 3
B (3×3)
Rows: 3
Cols: 3
Supports: fractions (1/2), decimals (0.5), constants (pi, e). Empty cells are treated as 0.

Calculation Results

1. Definition and formula: What is the rank of a matrix?

The rank of a matrix is the number of linearly independent rows or columns. Equivalently, the rank is the number of pivot positions in the matrix's reduced row echelon form (RREF).

Rank applies to both square and rectangular matrices. Row rank equals column rank.

Practical method (summary):

  1. Compute the RREF of matrix $A$ (Gauss–Jordan elimination).
  2. Count the number of nonzero (pivot) rows in RREF.
  3. That count is $\operatorname{rank}(A)$.

2. How to compute rank (quick recipe)

  • Convert $A$ to RREF using elementary row operations.
  • Count pivot rows (rows with leading 1's).
  • Alternatively, count maximal number of linearly independent columns (column rank).

Rank = number of pivots = number of nonzero rows in RREF.

3. Worked examples

Example 1

Compute the rank of

$$A=\begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 1 & 1 \end{bmatrix}$$

Row-reduce (summary):

$$\begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 1 & 1 \end{bmatrix} \xrightarrow{R_2-2R_1,\;R_3-R_1} \begin{bmatrix} 1 & 2 & 3 \\ 0 & 0 & 0 \\ 0 & -1 & -2 \end{bmatrix} \xrightarrow{R_3 \leftrightarrow R_2} \begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 2 \\ 0 & 0 & 0 \end{bmatrix}$$

There are 2 pivot rows, so

$$\operatorname{rank}(A)=2$$

Example 2

Find the rank of

$$B=\begin{bmatrix} 3 & 0 & 6 \\ 1 & -1 & 2 \\ 2 & -1 & 4 \end{bmatrix}$$

Row-reduce (summary):

$$\begin{bmatrix} 3 & 0 & 6 \\ 1 & -1 & 2 \\ 2 & -1 & 4 \end{bmatrix} \xrightarrow{R_1\leftrightarrow R_2 \text{ (or scale/elim.)}} \begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{bmatrix}$$

Two pivot rows ⇒

$$\operatorname{rank}(B)=2$$

4. Common mistakes (pitfalls)

  • Counting nonzero entries: Rank counts independent rows/columns, not nonzero entries.
  • Stopping too early in elimination: REF might hide dependencies; RREF clarifies pivots.
  • Mixing determinant logic: For square matrices, $\det\neq 0$ ⇒ full rank, but determinant is not defined for non-square matrices.
  • Assuming visually independent: Rows that look different may still be linearly dependent—use elimination to be sure.

5. Practice problems (click to show answers)

Try these. Answers are hidden — click Show Answer to reveal each rank.

Exercise 1

$$M_1=\begin{bmatrix} 1 & 3 & 5 \\ 2 & 6 & 10 \\ 1 & 1 & 2 \end{bmatrix}$$
Show Answer
$$\operatorname{rank}(M_1)=2$$

Rows 1 and 2 are dependent (row2 = 2·row1), so at most 2 independent rows; RREF confirms 2 pivots.

Exercise 2

$$M_2=\begin{bmatrix} 0 & 1 & 2 \\ 0 & 2 & 4 \\ 0 & 0 & 0 \end{bmatrix}$$
Show Answer
$$\operatorname{rank}(M_2)=1$$

Column 2 is a multiple of column 1? Here row 2 = 2·row1, so only one independent row remains.

Exercise 3

$$M_3=\begin{bmatrix} 4 & 2 \\ 2 & 1 \\ 6 & 3 \end{bmatrix}$$
Show Answer
$$\operatorname{rank}(M_3)=1$$

Each row is proportional (row3 = 1.5·row1, row2 = 0.5·row1), so only one independent row.

Exercise 4

$$M_4=\begin{bmatrix} 1 & -1 & 2 \\ 3 & -3 & 6 \\ 5 & -5 & 10 \end{bmatrix}$$
Show Answer
$$\operatorname{rank}(M_4)=1$$

All rows are scalar multiples of the first row (row2 = 3·row1, row3 = 5·row1), so rank = 1.


Copyright Notice: This article is original content from the Matrix Calculator website. Please credit the source when sharing or reproducing it. For more matrix computation tools, visit matrixcalcu.com.

Learn matrix multiplication more easily in just 2 minutes with this free game.

Matrix Multiplication Game