Transpose of a matrix is one of the most fundamental operations in linear algebra that every student must master. Whether you are studying mathematics, computer science, or machine learning, understanding how to transpose a matrix opens doors to advanced concepts like symmetric matrices, orthogonal transformations, and data manipulation. In this comprehensive guide, you will learn exactly what the transpose of a matrix means, how to calculate it step by step, explore its essential properties, and practice with solved examples.
🔑 Key Takeaways
- The transpose of a matrix swaps rows and columns: $(A^T)_{ij} = A_{ji}$.
- Key properties: $(A^T)^T = A$, $(A+B)^T = A^T + B^T$, and $(AB)^T = B^T A^T$.
- The transpose relates to dot products: $x \cdot y = x^T y$ (column vectors).
- For complex matrices, the conjugate transpose $A^H$ is used in quantum mechanics and signal processing.
- In machine learning, transpose appears in gradient computations, normal equations, and covariance matrices.
What Is the Transpose of a Matrix?
The transpose of a matrix is a new matrix obtained by interchanging its rows and columns. If you have a matrix $A$, its transpose is denoted as $A^T$ or $A’$. Simply put, the element at position $(i, j)$ in the original matrix moves to position $(j, i)$ in the transposed matrix.
🧪 Worked example
How to Transpose a Matrix: Step-by-Step
Follow these steps to find the transpose of any matrix:
Let $A$ be $m \times n$. Then $A^T$ will be $n \times m$.
For each row $i$ of $A$, that row becomes column $i$ of $A^T$.
Place element $A_{ij}$ at position $j,i$ in $A^T$.
Here is a quick example for a $3 \times 2$ matrix:
🧪 Worked example
Essential Properties of the Transpose
The transpose of a matrix satisfies several important properties. Mastering these helps you work with more advanced linear algebra and machine learning.
| Property | Formula | Example / Note |
|---|---|---|
| Double transpose | $(A^T)^T = A$ | Transposing twice returns the original. |
| Addition | $(A+B)^T = A^T + B^T$ | Only if $A$ and $B$ have the same size. |
| Scalar multiplication | $(cA)^T = c A^T$ | $c$ is any scalar. |
| Product (reversal) | $(AB)^T = B^T A^T$ | Order reverses! Proof below. |
| Determinant | $\det(A^T) = \det(A)$ | Holds for square matrices only. |
| Inverse | $(A^T)^{-1} = (A^{-1})^T$ | If $A$ is invertible. |
Proof: $(AB)^T = B^T A^T$
Let $A$ be $m \times n$ and $B$ be $n \times p$. The product $AB$ is $m \times p$. We want to show that the $(i,j)$ entry of $(AB)^T$ equals the $(i,j)$ entry of $B^T A^T$.
By definition, $(AB)^T_{ij} = (AB)_{ji}$. The $(j,i)$ entry of $AB$ is $\sum_{k=1}^n A_{jk} B_{ki}$. Now consider $B^T A^T$. The $(i,j)$ entry of $B^T A^T$ is $\sum_{k=1}^n (B^T)_{ik} (A^T)_{kj} = \sum_{k=1}^n B_{ki} A_{jk}$. Since multiplication is commutative for scalars, $\sum_{k} B_{ki} A_{jk} = \sum_{k} A_{jk} B_{ki}$. Thus both entries are equal, proving the property.
Transpose and the Dot Product
The dot product (or inner product) of two column vectors $x$ and $y$ of the same size can be written as $x \cdot y = x^T y$. This representation is fundamental in linear algebra and machine learning.
For example, $x = \begin{bmatrix}1\\2\end{bmatrix}$, $y = \begin{bmatrix}3\\4\end{bmatrix}$: $x^T y = [1\;2] \begin{bmatrix}3\\4\end{bmatrix} = 1\cdot3 + 2\cdot4 = 11$. This also equals the dot product $x \cdot y$.
This connection is crucial in ML: the normal equation for linear regression uses $X^T X \beta = X^T y$, where $X$ is the design matrix. The transpose of a matrix plays the same role of flipping rows and columns to compute inner products efficiently. For a deeper dive into dot product rules, see our 10 Dot Product Rules: The Essential Beginner’s Guide.
Geometric Interpretation of the Transpose
In linear algebra, a matrix $A$ represents a linear transformation $T: \mathbb{R}^n \to \mathbb{R}^m$. The transpose $A^T$ corresponds to the adjoint (or dual) map with respect to the standard dot product. Specifically, for any vectors $x \in \mathbb{R}^m$, $y \in \mathbb{R}^n$, we have:
$$ (Ax) \cdot y = x \cdot (A^T y). $$
This property says that the transpose is the unique linear map that “moves” the action of $A$ to the other side of the dot product. In geometric terms, if $A$ scales and rotates space, then $A^T$ performs the inverse rotation (but same scaling) in the dual space. For orthogonal matrices, $A^T = A^{-1}$, meaning the transformation is a pure rotation (or reflection) without scaling.
Conjugate Transpose (Hermitian Transpose)
For complex matrices, the ordinary transpose is replaced by the conjugate transpose (also called Hermitian transpose), denoted $A^H$ or $A^*$. It is obtained by first taking the transpose and then taking the complex conjugate of each entry: $(A^H)_{ij} = \overline{A_{ji}}$.
If $A$ has real entries, then $A^H = A^T$. For complex entries, the conjugate transpose is essential in quantum mechanics, signal processing, and advanced linear algebra. A matrix satisfying $A^H = A$ is called Hermitian (or self-adjoint) – the complex analogue of a symmetric matrix.
Example: Let $A = \begin{bmatrix} 1 & i \\ 2+3i & 4 \end{bmatrix}$. Then $A^T = \begin{bmatrix} 1 & 2+3i \\ i & 4 \end{bmatrix}$, and taking complex conjugates gives $A^H = \begin{bmatrix} 1 & 2-3i \\ -i & 4 \end{bmatrix}$.
Determinant of the Transpose
A remarkable property: for any square matrix $A$, $\det(A^T) = \det(A)$. This can be proved using the Leibniz formula for determinants:
$$ \det(A) = \sum_{\sigma \in S_n} \text{sgn}(\sigma) \prod_{i=1}^n A_{i,\sigma(i)}. $$
For $A^T$, the same sum runs over permutations but with entries $A^T_{i,\sigma(i)} = A_{\sigma(i), i}$. A change of variable $\tau = \sigma^{-1}$ shows the product is identical, and $\text{sgn}(\sigma) = \text{sgn}(\sigma^{-1})$, so the sum equals $\det(A)$. This equality implies that the determinant is invariant under transposition – one reason why symmetric matrices have real eigenvalues.
Transpose and Inverses
If $A$ is invertible, then so is $A^T$, and its inverse is the transpose of the inverse: $(A^T)^{-1} = (A^{-1})^T$. The proof uses the product reversal property:
We have $A A^{-1} = I$. Taking transposes: $(A A^{-1})^T = I^T = I$. But $(A A^{-1})^T = (A^{-1})^T A^T$. Hence $(A^{-1})^T A^T = I$, meaning $(A^T)^{-1} = (A^{-1})^T$.
This property is especially important for orthogonal matrices, where $A^T = A^{-1}$ by definition. Such matrices represent rotations or reflections and are widely used in computer graphics and data science.
Matrix Transpose in Machine Learning and Data Science
The transpose of a matrix appears constantly in machine learning. Here are three concrete applications:
✔️ Quick checklist
- ☑️ Data orientation: rows = samples, columns = features. If your matrix $X$ is $n \times p$, then $X^T$ is $p \times n$, used in computing covariance.
- ☑️ Gradient computation: For $f(x) = Ax$, the derivative w.r.t. $x$ is $A^T$ (if you treat $x$ as column vector).
- ☑️ Normal equation: Linear regression solves $X^T X \beta = X^T y$. The product $X^T X$ is a symmetric matrix.
- ☑️ Covariance matrix: For centered data matrix $X$ (rows = samples), the covariance is $\frac{1}{n-1} X^T X$ (if features are columns) or $\frac{1}{n-1} X X^T$ (if features are rows).
Understanding the transpose of a matrix is therefore not just academic—it is a practical skill for building models. For a deeper look at covariance matrices, see our Covariance Matrix Calculator: 3 Steps to Calculate & Analyze Data and How to Interpret Negative Covariance in Finance.
10+ Solved Examples of Transpose
Below are several examples to solidify your understanding. The first few are simple; later ones involve complex numbers and proofs.
Example 1 (2×2 real): $A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}$, $A^T = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix}$.
Example 2 (3×1 column vector): $v = \begin{bmatrix}1\\2\\3\end{bmatrix}$, $v^T = [1\;2\;3]$.
Example 3 (1×3 row vector): $w = [4\;5\;6]$, $w^T = \begin{bmatrix}4\\5\\6\end{bmatrix}$.
Example 4 (symmetric matrix): $A = \begin{bmatrix} 1 & 2 \\ 2 & 3 \end{bmatrix}$, $A^T = A$. The transpose of a matrix that is symmetric equals itself.
Example 5 (product reversal): Verify $(AB)^T = B^T A^T$ for $A = \begin{bmatrix}1&0\\2&1\end{bmatrix}$, $B = \begin{bmatrix}0&1\\1&0\end{bmatrix}$. Compute $AB = \begin{bmatrix}0&1\\1&2\end{bmatrix}$, $(AB)^T = \begin{bmatrix}0&1\\1&2\end{bmatrix}$. $B^T = \begin{bmatrix}0&1\\1&0\end{bmatrix}$, $A^T = \begin{bmatrix}1&2\\0&1\end{bmatrix}$, $B^T A^T = \begin{bmatrix}0&1\\1&0\end{bmatrix}\begin{bmatrix}1&2\\0&1\end{bmatrix} = \begin{bmatrix}0&1\\1&2\end{bmatrix}$. Matches.
Example 6 (complex conjugate transpose): $A = \begin{bmatrix} 1 & i \\ 2-i & 3i \end{bmatrix}$, $A^H = \begin{bmatrix} 1 & 2+i \\ -i & -3i \end{bmatrix}$.
Example 7 (det property): $A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}$, $\det(A) = ad – bc$. $A^T = \begin{bmatrix} a & c \\ b & d \end{bmatrix}$, $\det(A^T) = ad – cb = \det(A)$.
Example 8 (dot product via transpose): $x = \begin{bmatrix}1\\2\end{bmatrix}$, $y = \begin{bmatrix}3\\4\end{bmatrix}$, $x \cdot y = 11$ and $x^T y = [1\;2]\begin{bmatrix}3\\4\end{bmatrix} = 11$.
Frequently Asked Questions
What is the transpose of a matrix?+
The transpose of a matrix $A$ is the matrix $A^T$ formed by swapping rows and columns: $(A^T)_{ij} = A_{ji}$. If $A$ is $m \times n$, then $A^T$ is $n \times m$.
What is the formula for the transpose of a matrix?+
The formula is $(A^T)_{ij} = A_{ji}$. In matrix form, $A^T$ is the reflection over the main diagonal.
How do you transpose a 3×3 matrix?+
Take each row and write it as a column. For example, row 1 becomes column 1, row 2 becomes column 2, etc. If $A$ is 3×3, then $A^T$ is also 3×3.
Why is $(AB)^T = B^T A^T$?+
Because the $(i,j)$ entry of $(AB)^T$ equals the $(j,i)$ entry of $AB$, which is $\sum_k A_{jk} B_{ki}$. Meanwhile, the $(i,j)$ entry of $B^T A^T$ is $\sum_k B_{ki} A_{jk}$, which is the same sum (order of multiplication doesn’t matter for scalars).
What is the conjugate transpose?+
For a complex matrix $A$, the conjugate transpose $A^H$ (or $A^*$) is the transpose with each entry replaced by its complex conjugate: $(A^H)_{ij} = \overline{A_{ji}}$.
📚 Keep reading
The Ultimate Guide to 3×3 Matrix Multiplication: Formulas, Steps, and Examples