Skip to main content
Home
Calculating...

Matrix Rank Calculator: Find Rank of a Matrix Step by Step

Compute the rank of a matrix: the number of linearly independent rows or columns. The rank equals the number of pivots in the Reduced Row Echelon Form (RREF).

Calculator

Enter your matrix below and click "Calculate" to see the step-by-step solution.

Rows (m) =
Cols (n) =
Maximum size: 6ร—6

The rank is the number of linearly independent rows (or columns)

A Matrix A (m ร— n)

Computing rank...

Enter a matrix to compute its rank.

The rank equals the number of pivots in RREF.

Learn About Rank

Understanding the concepts behind the calculations.


What is Matrix Rank?

The rank of a matrix is the maximum number of linearly independent rows (or columns). It measures the "true dimension" of the information contained in the matrix.

$$ \boxed{\text{rank}(A) = \dim(\text{Col}(A)) = \dim(\text{Row}(A))} $$

For an m ร— n matrix:

  • Row rank = maximum number of linearly independent rows
  • Column rank = maximum number of linearly independent columns
  • Key fact: Row rank ALWAYS equals column rank! This common value is simply called the rank.

๐Ÿ’ก Intuition: Rank tells you how many dimensions the matrix "covers" when it transforms space. A rank 1 matrix crushes everything onto a line. A rank 2 matrix maps onto a plane.


How to Compute Rank

The RREF Method (Exact)

The most reliable way to find rank:

  1. Compute the Reduced Row Echelon Form (RREF) of the matrix
  2. Count the number of pivots (leading 1's in non-zero rows)
  3. That count is the rank!
$$ \text{rank}(A) = \text{number of pivots in RREF}(A) $$

Alternative Methods

  • Gaussian Elimination: Count pivots directly (same result)
  • Determinants: Find the largest square submatrix with non-zero determinant
  • SVD: Count non-zero singular values (most numerically stable)

Pro Tip: Use our Gauss-Jordan Elimination Calculator to find RREF and rank automatically!


The Rank-Nullity Theorem โญ

This is one of the most important theorems in linear algebra:

$$ \boxed{\text{rank}(A) + \text{nullity}(A) = n} $$

Where:

  • rank(A) = dimension of column space (number of independent columns)
  • nullity(A) = dimension of null space (number of free variables)
  • n = number of columns

Example: For a 3ร—5 matrix with rank 2:

  • rank = 2
  • nullity = n - rank = 5 - 2 = 3
  • This means the null space is 3-dimensional (3 free variables)

Rank & Invertibility

For a square nร—n matrix, rank tells you if the matrix is invertible:

โœ… Full Rank = Invertible

rank(A) = n โ†’ A is invertible

  • det(A) โ‰  0
  • All rows/columns independent
  • Null space = {0}

โŒ Rank Deficient = Singular

rank(A) < n โ†’ A is singular

  • det(A) = 0
  • Some rows/columns dependent
  • Non-trivial null space exists

๐Ÿ’ก Use our tools: Inverse Calculator โ€ข Determinant Calculator


Examples

Example 1: Full Rank 3ร—3 Matrix

$$ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 10 \end{bmatrix} $$

RREF has 3 pivots โ†’ rank = 3 (invertible)

Example 2: Rank Deficient Matrix

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

Second row = 2 ร— first row, third row = 3 ร— first row โ†’ rank = 1

Only 1 independent row. Nullity = 3 - 1 = 2 (two free variables).

Example 3: Rectangular Matrix

$$ A = \begin{bmatrix} 1 & 2 & 3 & 4 \\ 5 & 6 & 7 & 8 \\ 9 & 10 & 11 & 12 \end{bmatrix} $$

3ร—4 matrix. After elimination, 2 pivots โ†’ rank = 2

Max possible rank for 3ร—4 is min(3,4) = 3. This matrix has rank 2 (rank deficient by 1).

Example 4: Zero Matrix

$$ A = \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix} $$

rank = 0 (no independent rows/columns)

Example 5: Identity Matrix

$$ I = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} $$

rank = n (full rank, invertible)


Equivalent Definitions of Rank

The rank can be defined in several equivalent ways. All give the same number:

  • โœ… Number of pivots in RREF
  • โœ… Dimension of the column space (Col(A))
  • โœ… Dimension of the row space (Row(A))
  • โœ… Maximum number of linearly independent columns
  • โœ… Maximum number of linearly independent rows
  • โœ… rank(A) = rank(Aแต€) (rank equals rank of transpose)
  • โœ… Size of the largest non-zero minor (determinant)
  • โœ… Number of non-zero singular values

๐Ÿ“Š Check it out: Use our Linear Independence Checker to test if rows/columns are independent!


Geometric Interpretation

A matrix represents a linear transformation from โ„โฟ โ†’ โ„แต. The rank tells you the dimension of the image (output space).

2ร—2 Matrix Examples

  • rank = 0: Maps everything to zero
  • rank = 1: Maps plane onto a line
  • rank = 2: Maps plane onto entire plane

3ร—3 Matrix Examples

  • rank = 0: Maps to origin
  • rank = 1: Maps to a line
  • rank = 2: Maps to a plane
  • rank = 3: Maps to all of โ„ยณ

Key Insight: rank = dimension of the transformation's image. It tells you how many dimensions the matrix "covers" or "reaches".


Real-World Applications

๐Ÿ“ธ Data Compression

Low-rank approximations (SVD) compress images by keeping only important information.

๐Ÿ“Š Machine Learning (PCA)

Principal Component Analysis uses rank to determine intrinsic data dimension.

๐Ÿ”ง Control Theory

Rank determines controllability and observability of systems.

๐Ÿ“ˆ Statistics

Degrees of freedom in regression = rank of design matrix.

๐Ÿงฌ Bioinformatics

Rank reveals the number of independent gene expression patterns.

๐Ÿ“ก Signal Processing

Rank helps separate signals from noise.

๐Ÿ”— Explore further: Least Squares โ€ข SVD Calculator โ€ข Null Space


Frequently Asked Questions

Q: Can rank be greater than number of rows or columns?

A: No! Always 0 โ‰ค rank(A) โ‰ค min(m, n). You can't have more independent rows than total rows.

Q: What does rank 1 tell us?

A: All rows are multiples of each other. The matrix collapses everything onto a single line.

Q: Is rank(A) = rank(Aแต€) always true?

A: Yes! Row rank always equals column rank. This is a fundamental theorem of linear algebra.

Q: How does rank help solve Ax = b?

A: A solution exists iff rank(A) = rank([A|b]). If rank(A) = n, the solution is unique.

Q: What's the rank of a zero matrix?

A: Zero. No independent rows or columns.

Q: Can a non-square matrix have full rank?

A: Yes! Full rank = rank = min(m, n). For a 3ร—5 matrix, full rank = 3 (all rows independent).


Practice Problems

Beginner

  1. What is the rank of a 4ร—4 identity matrix?
  2. A 3ร—3 matrix has two identical rows. What can you say about its rank?
  3. Find the rank of [[1, 0], [0, 0]]

Intermediate

  1. A 3ร—5 matrix has rank 2. What is its nullity?
  2. If A is 4ร—4 with det(A) = 0, what is the maximum possible rank?
  3. Find conditions for a 2ร—2 matrix to have rank 1.

Advanced

  1. Prove: rank(AB) โ‰ค min(rank(A), rank(B))
  2. If A is mร—n and rank(A) = m, what does that imply about solutions to Ax = b?
Click to reveal solutions

1. rank = 4 (full rank)

2. rank โ‰ค 2 (maximum 2, could be 1 or 2)

3. rank = 1

4. nullity = 5 - 2 = 3

5. Maximum rank = 3 (cannot be 4 if singular)

6. ad - bc = 0 but not all entries zero

7. Image of AB is subset of image of B and A

8. System Ax = b always has a solution (columns span all of โ„แต), unique if n = m


Summary

Key Takeaways

  • Rank = number of linearly independent rows/columns
  • 0 โ‰ค rank โ‰ค min(m, n)
  • rank = 0 โŸบ A is zero matrix
  • rank = n (square) โŸบ A is invertible
  • Rank + Nullity = n (Rank-Nullity Theorem)
  • rank(A) = rank(Aแต€) always
  • Rank reveals the true dimension of a matrix's information

๐Ÿ’ฌ Still have questions? Try our Gauss-Jordan Elimination calculator to see rank in action, or explore related tools above!