Matrix Transpose: Flipping Across the Diagonal

April 13, 2026

Problem

Find the transpose of A = [[1,2,3],[4,5,6]]. Explain how the transpose swaps rows with columns and list the key properties.

Explanation

Definition

The transpose of an m×nm \times n matrix AA, written ATA^T, is the n×mn \times m matrix obtained by reflecting AA across its main diagonal. Equivalently: (AT)ij=Aji(A^T)_{ij} = A_{ji}

Row ii of AA becomes column ii of ATA^T, and vice versa.

Step-by-step

A=(123456)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} (2 rows × 3 columns).

  • Row 1 of AA: (1,2,3)(1, 2, 3) → column 1 of ATA^T.
  • Row 2 of AA: (4,5,6)(4, 5, 6) → column 2 of ATA^T.

AT=(142536)A^T = \begin{pmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{pmatrix}

Shape flips: AA is 2×32 \times 3, ATA^T is 3×23 \times 2. Main diagonal entries (positions where i=ji = j) stay the same; off-diagonal entries swap.

Key properties

  • Double transpose: (AT)T=A(A^T)^T = A.
  • Transpose of a sum: (A+B)T=AT+BT(A + B)^T = A^T + B^T.
  • Transpose of a product (swap order): (AB)T=BTAT(AB)^T = B^T A^T.
  • Transpose of inverse: (A1)T=(AT)1(A^{-1})^T = (A^T)^{-1}.
  • Transpose of a scalar multiple: (cA)T=cAT(cA)^T = c A^T.

The swap in (AB)T=BTAT(AB)^T = B^T A^T surprises people. A quick sanity check: if AA is 2×32 \times 3 and BB is 3×43 \times 4, then ABAB is 2×42 \times 4 so (AB)T(AB)^T is 4×24 \times 2. On the other side: ATA^T is 3×23 \times 2 and BTB^T is 4×34 \times 3, so BTATB^T A^T is 4×24 \times 2. Dimensions match — and the identity holds entry-by-entry.

Special kinds of matrices

  • Symmetric: AT=AA^T = A. Only square matrices can be symmetric. Example: (1223)\begin{pmatrix} 1 & 2 \\ 2 & 3 \end{pmatrix}.
  • Skew-symmetric: AT=AA^T = -A. All diagonal entries are zero.
  • Orthogonal: QTQ=IQ^T Q = I, so QT=Q1Q^T = Q^{-1}.

Where transpose appears

  • Dot products: uv=uTv\mathbf{u} \cdot \mathbf{v} = \mathbf{u}^T \mathbf{v} when vectors are columns.
  • Normal equations in least squares: ATAx=ATbA^T A \mathbf{x} = A^T \mathbf{b}.
  • Gram matrix: ATAA^T A — symmetric, positive semidefinite, central to SVD and QR.
  • Quadratic forms: xTAx\mathbf{x}^T A \mathbf{x} appears in optimization and statistics.
  • Data science: "rows as samples / columns as features" vs. "rows as features / columns as samples" differ by transposition.

Common mistakes

  • Forgetting the shape flip. A 2×32 \times 3 matrix transposes to a 3×23 \times 2, not another 2×32 \times 3.
  • Mis-ordering the product transpose. (AB)T(AB)^T is BTATB^T A^T, not ATBTA^T B^T.
  • Assuming diagonal entries change. On a square matrix, diagonal positions (i,i)(i, i) are fixed — the swap is only off-diagonal.

Try it in the visualization

A 2×3 matrix is drawn as a grid. Each cell flips across the main diagonal, swapping positions (i,j)(j,i)(i, j) \leftrightarrow (j, i). Elements animate to their new positions while shape changes from wide to tall.

Interactive Visualization

Parameters

2.00
3.00
4.00
Original [[1,2,3],[4,5,6]]
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Matrix Transpose: Flipping Across the Diagonal | MathSpin