Algebra • Linear Algebra Flagship

Matrix Rank Calculator

Determine the rank, nullity, linearly independent rows, and fundamental subspace dimensions of any square or rectangular matrix via step-by-step Gaussian row reduction.

Verified Rank-Nullity Theorem Computations
Last Updated: September 2026
Direct Answer & Overview
Verified Educational Guide

Matrix Rank Definition & Theorem

The rank of a matrix is the maximum number of linearly independent row or column vectors. It equals the number of non-zero rows in its Row Echelon Form (REF). For an m × n matrix, 0 ≤ rank(A) ≤ min(m, n).

Primary Mathematical Formula Standard Mathematical Model
Standard Equation
ƒ(x)
Q.E.D.
rank(A) = Number of pivots in REF(A), Rank-Nullity: rank(A) + nullity(A) = n (columns)
Evaluated with exact mathematical formulation • Rigorously verified
Exact Formula
Input Parameters
Required
1
Matrix dimensions (Rows m × Columns n)
2
Matrix coefficients
Expected Outputs
Calculated
Matrix rank integer value
Nullity (dimension of kernel / null space)
Full rank vs rank-deficient classification
Row Echelon Form reduction steps
Worked Numerical Example
Instant Verification
Find rank and nullity of 3x3 matrix [[1, 2, 3], [2, 4, 6], [1, 1, 1]]
→ Row 2 is exactly 2 × Row 1, so R₂ vanishes to zeros. R₃ - R₁ yields [0, -1, -2] (pivot 2). There are 2 non-zero rows in REF.
rank(A) = 2, nullity(A) = 3 - 2 = 1 (Rank Deficient)

Matrix Rank Definition & Vector Space Dimension

The rank of an $m \times n$ matrix $A$, denoted $\text{rank}(A)$ or $\text{rk}(A)$, is defined as the dimension of the vector space generated (spanned) by its rows or columns:

$$\text{rank}(A) = \dim(\text{col}(A)) = \dim(\text{row}(A)) \le \min(m, n)$$

Geometrically, if a matrix $A$ acts as a linear transformation mapping vectors from $\mathbb{R}^n$ to $\mathbb{R}^m$, the rank is the spatial dimension of the output image. A $3 \times 3$ matrix with rank 2 compresses all 3D space onto a 2D plane passing through the origin.

Row Rank Equals Column Rank Theorem

One of the deepest theorems in linear algebra states that the maximum number of linearly independent rows always equals the maximum number of linearly independent columns:

Even when a matrix is non-square (e.g. $2 \times 100$), its 100 column vectors in $\mathbb{R}^2$ can span at most a 2-dimensional plane, so the column rank can never exceed 2—matching the row rank exactly.

$\text{rank}(A) = \text{rank}(A^T)$

The Rank-Nullity Theorem & Kernel Dimension

For any linear transformation $T: V \to W$ represented by an $m \times n$ matrix $A$, the total dimension of the domain $n$ is partitioned between the dimension of the image ($\text{rank}$) and the dimension of the kernel ($\text{nullity}$):

$$\text{rank}(A) + \text{nullity}(A) = n \quad (\text{number of columns})$$
Image / Column Space ($\text{rank}$)

The subspace of all possible output vectors $A\mathbf{x}$. Corresponds to pivot columns in REF.

Kernel / Null Space ($\text{nullity}$)

The subspace of all vectors $\mathbf{x}$ mapped to zero ($A\mathbf{x} = \mathbf{0}$). Corresponds to free variables.

Full Rank vs Rank-Deficient Matrices

Full Rank Matrix

$\text{rank}(A) = \min(m, n)$.

  • For square $n \times n$: $\det(A) \neq 0$, $A$ is invertible ($A^{-1}$ exists).
  • Trivial null space: $\text{nullity}(A) = 0$.
  • $A\mathbf{x} = \mathbf{b}$ has a unique solution.
Rank-Deficient (Singular)

$\text{rank}(A) < \min(m, n)$.

  • For square $n \times n$: $\det(A) = 0$, non-invertible.
  • Non-trivial null space: $\text{nullity}(A) \ge 1$.
  • Rows/columns contain linear dependencies.

Applications in Data Science (PCA, SVD & Compression)

Low-Rank Matrix Approximation

Singular Value Decomposition (SVD) truncates high-dimensional data matrices into rank-$k$ approximations, compressing images and recommendation systems (Netflix algorithm).

Principal Component Analysis (PCA)

Identifies the rank (intrinsic dimensionality) of high-dimensional feature datasets, eliminating collinearity and redundant features.

Robotics & Kinematic Singularities

When a robotic arm's Jacobian matrix drops rank (rank deficiency), the robot loses degrees of freedom and cannot move in certain spatial directions.

Graded Step-by-Step Numerical Solutions

Example 1 • 3x4 Rectangular Matrix Standard Tier

Find rank and nullity of $A = \begin{pmatrix} 1 & 3 & 1 & 4 \\ 2 & 6 & 3 & 9 \\ 3 & 9 & 4 & 13 \end{pmatrix}$

1. Forward elimination: $R_2 - 2R_1 \rightarrow R_2 \implies [0, 0, 1, 1]$. $R_3 - 3R_1 \rightarrow R_3 \implies [0, 0, 1, 1]$.

2. Zero out row 3: $R_3 - R_2 \rightarrow R_3 \implies [0, 0, 0, 0]$.

3. Number of non-zero rows = 2, so $\text{rank}(A) = 2$.

4. Total columns $n = 4$, so $\text{nullity}(A) = 4 - 2 = 2$.

Common Pitfalls & Zero-Row Recognition

Pitfall 1: Counting Non-Zero Rows Before Completing REF
Never estimate rank from an unreduced matrix. Even if all initial rows contain non-zero numbers, linear combinations may cause multiple rows to cancel to zero during Gaussian elimination.
Pitfall 2: Confusing Columns $n$ and Rows $m$ in Rank-Nullity
In the Rank-Nullity Theorem $\text{rank}(A) + \text{nullity}(A) = n$, $n$ always represents the number of columns (domain dimension), NOT the number of rows $m$.
Fact-Checked & Verified • Computational Accuracy Standards
Updated July 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is the rank of a matrix?
The rank of a matrix is the maximum number of linearly independent row vectors (or column vectors) in the matrix. It represents the true dimensionality of the vector space spanned by its rows or columns.
Why is row rank always equal to column rank?
A fundamental theorem of linear algebra establishes that the dimension of the row space (row rank) is always strictly identical to the dimension of the column space (column rank) for any m × n matrix, even if m ≠ n.
What is the Rank-Nullity Theorem?
The Rank-Nullity Theorem states that for any linear map represented by an m × n matrix A, the rank of A plus the nullity (dimension of the kernel / null space) equals the total number of columns n: rank(A) + nullity(A) = n.
What is a full rank matrix?
An m × n matrix has full rank if its rank equals the maximum possible value, which is min(m, n). A square n × n matrix has full rank (rank = n) if and only if its determinant is non-zero and it is invertible.
How do you find the rank of a matrix using Gaussian elimination?
Row-reduce the matrix to Row Echelon Form (REF) using elementary row operations. The rank equals the number of non-zero rows (or leading pivot entries) in the resulting echelon matrix.