Matrix Rank Calculator

Find the rank of a matrix by counting the pivots after row reduction.

Matrix A
Rows
2
Columns
3

Write rows separated by semicolons, like 1, 2; 3, 4.

Try

Result

You enteredrank⁡(123456)\operatorname{rank}\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}

2\displaystyle 2

Row echelon form

(10−1012)\displaystyle \begin{pmatrix} 1 & 0 & -1 \\ 0 & 1 & 2 \end{pmatrix}

Nullity

1\displaystyle 1
Show the work
  1. Gauss-Jordan elimination

    The rank is unchanged by row operations, so reduce the matrix to reduced row echelon form. Work column by column: make a pivot (a leading 1) with a swap or a scaling, then clear every other entry in its column.

    A=(123456)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}
  2. Row operation: add a multiple of one row to another

    Subtract 44 times R1R_1 from R2R_2 to turn the entry in row 2, column 1 into 0.

    R2→R2−4R1(1230−3−6)R_2 \to R_2 - 4R_1 \quad \begin{pmatrix} 1 & 2 & 3 \\ 0 & -3 & -6 \end{pmatrix}
  3. Row operation: scale a row

    Multiply R2R_2 by −13-\frac{1}{3} so that the pivot in row 2, column 2 becomes 1.

    R2→−13R2(123012)R_2 \to -\frac{1}{3}R_2 \quad \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & 2 \end{pmatrix}
  4. Row operation: add a multiple of one row to another

    Subtract 22 times R2R_2 from R1R_1 to turn the entry in row 1, column 2 into 0.

    R1→R1−2R2(10−1012)R_1 \to R_1 - 2R_2 \quad \begin{pmatrix} 1 & 0 & -1 \\ 0 & 1 & 2 \end{pmatrix}
  5. Count the non-zero rows

    The rank is the number of non-zero rows in the reduced matrix, which is the number of pivots. The pivots are in row 1, column 1; row 2, column 2.

    Using rank⁡(A)=number of non-zero rows\operatorname{rank}\left(A\right) = \text{number of non-zero rows}

    rank⁡(A)=rank⁡(10−1012)=2\operatorname{rank}\left(A\right) = \operatorname{rank}\begin{pmatrix} 1 & 0 & -1 \\ 0 & 1 & 2 \end{pmatrix} = 2
  6. Rank and nullity

    The nullity counts the columns with no pivot, that is, the free directions: the number of columns minus the rank. Here AA has 3 columns.

    Using rank⁡(A)+nullity⁡(A)=number of columns\operatorname{rank}\left(A\right) + \operatorname{nullity}\left(A\right) = \text{number of columns}

    nullity⁡(A)=3−2=1\begin{aligned} \operatorname{nullity}\left(A\right) &= 3 - 2 \\ &= 1 \end{aligned}
  7. Result

    So the rank of AA is 22. It is at most the smaller of 2 rows and 3 columns.

Worked examples