Row Space Basis Calculator
Find a basis for the row space of a matrix, formed by all linear combinations of its rows. The non-zero rows of a row echelon form provide a linearly independent basis for the row space.
A
Learn About Row Space Basis
In linear algebra, the row space of a matrix $\mathbf{A} \in \mathbb{R}^{m \times n}$ is the vector subspace of $\mathbb{R}^n$ spanned by its row vectors:
Equivalently, the row space of $\mathbf{A}$ is the column space of its transpose:
The row space consists of all row vectors that can be produced by left-multiplying $\mathbf{A}$ by a row vector $\mathbf{y} \in \mathbb{R}^m$: $\operatorname{Row}(\mathbf{A}) = \{\mathbf{y}\mathbf{A} \mid \mathbf{y} \in \mathbb{R}^m\}$.
Invariance Under Elementary Row Operations
A fundamental theorem of matrix algebra states that elementary row operations do not alter the row space of a matrix:
Because row operations merely replace rows with linear combinations of existing rows, the overall subspace spanned by the rows remains identical throughout elimination.
Basis Extraction Algorithm
To construct a basis for the row space:
- Reduce to Echelon Form: Transform $\mathbf{A}$ into Row Echelon Form (REF) or Reduced Row Echelon Form (RREF) using Gaussian elimination.
- Collect Non-Zero Rows: The non-zero rows of the echelon matrix form a linearly independent basis for $\operatorname{Row}(\mathbf{A})$.
Because the pivot entries appear in a staircase pattern, the non-zero rows are automatically linearly independent and span the exact same row space as $\mathbf{A}$.
Fundamental Contrast: Row Space vs. Column Space
- For the Row Space: You can directly use the non-zero rows of $\operatorname{RREF}(\mathbf{A})$. Row operations preserve the row span.
- For the Column Space: You cannot use the columns of $\operatorname{RREF}(\mathbf{A})$. Row operations alter column vectors, so you must select the pivot columns from the original matrix $\mathbf{A}$.
Dimension and Rank
The dimension of the row space equals the number of non-zero rows in RREF, which is the rank of the matrix:
Worked Numerical Example
Find a basis and dimension for the row space of:
- Row Reduce to RREF:
- $R_2 \leftarrow R_2 - 2R_1 \implies [0, 0, 1]$
- $R_3 \leftarrow R_3 + R_1 \implies [0, 0, 2]$
- $R_3 \leftarrow R_3 - 2R_2 \implies [0, 0, 0]$
- $R_1 \leftarrow R_1 - 3R_2 \implies [1, -2, 0]$
- Extract Non-Zero Rows:
Row 1 and Row 2 contain leading pivots ($1$s); Row 3 is entirely zero.
- Form the Basis:
The original third row was linearly dependent: $\mathbf{r}_3 = -5\mathbf{r}_1 + 2\mathbf{r}_2$.
Can I use the original rows of matrix A as a basis instead of RREF rows?
Yes, provided you select the original rows corresponding to the pivot positions identified during column reduction of $\mathbf{A}^T$. However, using the non-zero rows of $\operatorname{RREF}(\mathbf{A})$ is mathematically preferred because they provide a canonical echelon basis with leading ones and zeros in pivot columns, making coordinates immediately readable.
In what ambient space does the row space live?
For an $m \times n$ matrix, each row contains $n$ entries. Therefore, the row space $\operatorname{Row}(\mathbf{A})$ is always a subspace of the domain $\mathbb{R}^n$, whereas the column space $\operatorname{Col}(\mathbf{A})$ lives in the codomain $\mathbb{R}^m$.
How does the row space connect to the null space?
The row space and null space are orthogonal complements in $\mathbb{R}^n$:
Every vector $\mathbf{x} \in \operatorname{Null}(\mathbf{A})$ satisfies $\mathbf{A}\mathbf{x} = \mathbf{0}$, meaning $\mathbf{x}$ is perpendicular to every row of $\mathbf{A}$.
Why does row rank always equal column rank?
Because the number of leading pivots in $\operatorname{RREF}(\mathbf{A})$ simultaneously counts both the number of non-zero rows (row rank) and the number of pivot columns (column rank). Thus, $\dim(\operatorname{Row}(\mathbf{A})) = \dim(\operatorname{Col}(\mathbf{A})) = \operatorname{rank}(\mathbf{A})$ for every matrix.
- Orthogonal Space Decomposition: Any vector $\mathbf{x} \in \mathbb{R}^n$ can be uniquely decomposed into the sum of a row space vector and a null space vector: $\mathbf{x} = \mathbf{x}_{\text{row}} + \mathbf{x}_{\text{null}}$, where $\mathbf{x}_{\text{row}} \in \operatorname{Row}(\mathbf{A})$ and $\mathbf{x}_{\text{null}} \in \operatorname{Null}(\mathbf{A})$. This property is the foundation of least-squares approximations and pseudoinverses.
- Canonical Echelon Uniqueness: While a matrix has infinitely many different bases for its row space, the non-zero rows of its Reduced Row Echelon Form form the unique canonical basis for $\operatorname{Row}(\mathbf{A})$.