VectorLab

Visualize vectors, solve algebra & calculus step by step, with guides

← Back to the tools

How to Find the Rank of a Matrix

The rank of a matrix tells you how many of its rows or columns carry independent information. Here is what it means, how to compute it by hand, and how to check it.

What rank means

The rank of a matrix A is the number of linearly independent rows, which always equals the number of linearly independent columns. Equivalently, it is the dimension of the column space: the set of all outputs Ax. A 3×3 matrix with rank 3 sends space onto all of ℝ³. With rank 2 it flattens space onto a plane, and with rank 1 onto a line. Rank 0 only happens for the zero matrix.

Rank decides whether a square matrix is invertible (full rank), how many solutions a system has, and how large the null space is. The rank–nullity theorem ties these together: for an m×n matrix, rank + nullity = n, where n is the number of columns.

Method: row reduce and count pivots

  1. Use row operations (swap rows, multiply a row by a nonzero number, add a multiple of one row to another) to reach row-echelon form.
  2. Count the nonzero rows, or equivalently the pivots. That count is the rank.

Row operations never change the rank, which is why this works.

Worked example

Find the rank of A with rows (1, 2, 3), (2, 4, 6) and (1, 0, 1).

  • R₂ − 2R₁ gives (0, 0, 0). The second row was just twice the first.
  • R₃ − R₁ gives (0, −2, −2).
  • Swap R₂ and R₃ to get the echelon form: (1, 2, 3), (0, −2, −2), (0, 0, 0).

There are two nonzero rows, so rank(A) = 2. The matrix has 3 columns, so the nullity is 3 − 2 = 1. Solving Ax = 0 gives the null space spanned by (−1, −1, 1). Check the first row: −1 − 2 + 3 = 0. ✓

Geometric view

The rows (1, 2, 3) and (2, 4, 6) point in the same direction, so together they add nothing new. Dependent rows are the signal that rank is lower than the matrix size. In the tool, the output-space picture shows the image shrinking to a line or plane as rank drops.

Common mistakes

  • Counting rows of the original matrix instead of nonzero rows after reduction.
  • Forgetting that rank is limited by min(rows, columns).
  • Arithmetic slips with fractions; use exact arithmetic in the tool to avoid rounding noise that makes a tiny leftover number look like a pivot.

FAQ

Can the rank be larger than the number of rows?

No. Rank can never exceed min(m, n) for an m×n matrix.

Is rank(A) the same as rank(Aᵀ)?

Yes. Row rank and column rank are always equal.

What does full rank mean?

The rank equals min(m, n). For a square matrix, that means it is invertible and its determinant is nonzero.

Where rank is used

Rank tells you whether a system Ax = b can be solved at all: it is consistent exactly when A and the augmented matrix [A | b] have the same rank. It also gives the dimension of a subspace, flags redundant columns in a data table, and decides whether a transformation can be undone. A square matrix is invertible only when its rank equals its size.

Open the interactive tools →