Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Matrix Transpose


Symbolic visualization of A → A^T — four mental models for the same operation.

A→AT·3×4|Cell-by-cell
Dimensions of A?A is the input matrix. A^T has the swapped shape: if A is m×n, then A^T is n×m. There are no shape restrictions on transpose — any matrix can be transposed.
A3×4→AT4 × 3
A3×4
a1,1
a1,2
a1,3
a1,4
a2,1
a2,2
a2,3
a2,4
a3,1
a3,2
a3,3
a3,4
→
AT4×3
?
?
?
?
?
?
?
?
?
?
?
?
Step 1 / 14

Step explanations

1Cell-by-cell — strategy overview
Sweep A in row-major order. For each entry ai,j, place it at position [j, i] of AT. 12 steps total.
The definition made literal: m × n steps, one index swap each. Learn more about the cell-by-cell method · all four methods














Key Terms

Transpose — the operation that turns an m×nm \times n matrix AA into an n×mn \times m matrix ATA^T by swapping rows and columns: (AT)i,j=aj,i(A^T)_{i,j} = a_{j,i}.

Main diagonal — the entries ai,ia_{i,i} where row index equals column index. Defined fully only for square matrices.

Row-column swap — the defining rule of transposition: the entry at row ii, column jj of AA moves to row jj, column ii of ATA^T.

Diagonal reflection — the geometric view of transposition as a mirror across the main diagonal of AA. For non-square AA, this becomes an abstract reflection axis.

Symmetric matrix — a square matrix that equals its own transpose: A=ATA = A^T. Equivalently, ai,j=aj,ia_{i,j} = a_{j,i} for all i,ji, j.

Involution — an operation that undoes itself. Transpose is involutive: (AT)T=A(A^T)^T = A.

Getting Started with the Visualizer

Choose a shape for AA and a mental model for how to build ATA^T, then watch the operation animate cell by cell.

• Open the Size tab to set rows and columns of AA — each ranges from 1 to 5. The shape of ATA^T updates automatically beside the steppers
• Open the Method tab to pick one of four equivalent strategies for constructing ATA^T
• A summary strip at the right of the tab bar always shows the current shape and active method
• The scene player below the controls supports playback speed, step indicator, and a scrollable step log

Every method produces the identical ATA^T — they differ only in how the operation is broken into steps and what is highlighted at each step.

The Four Methods

The Method tab offers four mental models of the same operation, each useful in a different context.

• Cell-by-cell — sweeps AA in row-major order and places each ai,ja_{i,j} at position [j,i][j, i] of ATA^T. Total steps: m×nm \times n. This is the textbook definition view
• Row-as-column — moves a whole row of AA into the corresponding column of ATA^T in one step. Total steps: mm. Best for seeing rows become columns
• Column-as-row — symmetric to row-as-column. Moves each column of AA into a row of ATA^T. Total steps: nn
• Diagonal reflection — treats transpose as a single geometric mirror across the main diagonal (or an abstract diagonal-like axis for rectangular AA). One conceptual step

The diagonal reflection card is marked geometric because it is the only purely visual method — no per-cell mechanics, just one reflection.

Cell-by-Cell: the Definition, One Entry at a Time

The first strategy is the definition made literal. It sweeps AA in row-major order and, at each step, places the single entry ai,ja_{i,j} into position [j,i][j, i] of ATA^T.

At the default size that is 3×4=123 \times 4 = 12 steps, one per entry. The frozen picture below is step 6: five entries have already landed in ATA^T, one is in flight, and the remaining cells of ATA^T are still empty placeholders.
A3×4a1,1a1,2a1,3a1,4a2,1a2,2a2,3a2,4a3,1a3,2a3,3a3,4→AT4×3a1,1a2,1?a1,2a2,2?a1,3??a1,4??
Cell-by-cell, step 6 of 12

A is 3×4 on the left, Aᵀ is 4×3 on the right. Five entries have landed, one is highlighted in transit, and the remaining destination cells still show the empty placeholder.

The index swap is the whole operation. Everything else the transpose does — the shape change, the symmetry test, the reversal in (AB)T=BTAT(AB)^T = B^T A^T — follows from ai,j↦aj,ia_{i,j} \mapsto a_{j,i} and nothing more.

Watch the shape while it fills. AA is 3×43 \times 4 and ATA^T is 4×34 \times 3: the entry at row 2, column 4 of AA has nowhere to go in a 3×43 \times 4 target, which is why the destination has to be a different shape rather than the same grid rearranged.

This method is the slowest of the four and the one worth running first, because the other three are shortcuts that assume you already believe this one.

Row-as-Column: Moving a Whole Row at Once

The second strategy takes an entire row of AA and stands it up as the corresponding column of ATA^T. Row 1 becomes column 1, row 2 becomes column 2, and so on.

That is 33 steps at the default size instead of 1212 — one per row of AA. The still below is step 2, with the first row already standing as a column and the second in progress.
A3×4a1,1a1,2a1,3a1,4a2,1a2,2a2,3a2,4a3,1a3,2a3,3a3,4→AT4×3a1,1a2,1?a1,2a2,2?a1,3a2,3?a1,4a2,4?
Row-as-column, step 2 of 3

A whole row of A is highlighted at once, together with the column of Aᵀ it becomes. Three steps cover the entire matrix instead of twelve.

The step count is the useful observation. Cell-by-cell needs m×nm \times n moves; this needs mm. Both perform the same relabelling, but grouping the work by row makes the structure visible: a transpose is not twelve unrelated moves, it is three rows being re-oriented.

This is also the reading that makes ATA^T easy to write out by hand. Take the rows of AA in order, write each one down a column, and stop — no index arithmetic required.

Column-as-Row: the Same Operation From the Other Side

The third strategy is the mirror of the second: each column of AA is laid down as the corresponding row of ATA^T. Column 1 becomes row 1, column 2 becomes row 2, and ATA^T fills top-down rather than left-to-right.

At the default size that is 44 steps, one per column of AA. The still is step 2 of 4.
A3×4a1,1a1,2a1,3a1,4a2,1a2,2a2,3a2,4a3,1a3,2a3,3a3,4→AT4×3a1,1a2,1a3,1a1,2a2,2a3,2??????
Column-as-row, step 2 of 4

The mirror grouping: a full column of A and the row of Aᵀ it turns into. Same result as row-as-column, reached in four steps rather than three.

Row-as-column and column-as-row produce identical results, and the difference in step count — 33 against 44 — is purely a matter of which dimension you group by. On a 3×43 \times 4 matrix, grouping by rows takes three moves and grouping by columns takes four; on a square matrix the two counts coincide.

Holding both readings at once is what makes the transpose easy to think about: rows of AA are columns of ATA^T, and columns of AA are rows of ATA^T. Those are two descriptions of one fact, not two separate rules to remember.

Diagonal Reflection: One Geometric Move

The fourth strategy drops the step-by-step framing entirely. Transposing is a reflection across the main diagonal — a single geometric operation rather than a sequence of moves.

The colouring carries the argument: cells on the diagonal are marked separately from those above it and those below it. Reflecting swaps the above-group with the below-group and leaves the diagonal fixed.
A3×4a1,1a1,2a1,3a1,4a2,1a2,2a2,3a2,4a3,1a3,2a3,3a3,4→AT4×3a1,1a2,1a3,1a1,2a2,2a3,2a1,3a2,3a3,3a1,4a2,4a3,4
Diagonal reflection, the geometric view

No step sequence at all. Cells are coloured by their relation to the main diagonal - on it, above it, below it - and the transpose swaps the two off-diagonal groups while the diagonal stays put.

Two consequences fall straight out of that picture. First, (AT)T=A(A^T)^T = A — reflect twice about the same axis and every entry returns home. Second, the diagonal entries never move, which is why tr⁡(AT)=tr⁡(A)\operatorname{tr}(A^T) = \operatorname{tr}(A) and why a symmetric matrix — one satisfying A=ATA = A^T — is exactly a matrix whose above-diagonal half mirrors its below-diagonal half. The symmetric and skew-symmetric section develops that.

For a rectangular AA the axis is an abstraction rather than a line you could draw through the grid, since the source and target have different shapes. The tool labels it as such. The index swap still holds; only the tidy geometric picture needs the matrix to be square.

Reading the Scene Player

Each animated scene combines highlights, arrows, and a caption.

• Primary highlight on AA marks the source row, column, or cell currently being moved
• Accent highlight on ATA^T marks the destination
• Curved arrows connect source to destination — in fan-out methods (row-as-column, column-as-row), arrows alternate above and below for clarity
• The title shows the cell-level or row/column-level transformation in math notation
• The formula caption below describes the step in words

In the diagonal reflection method, no arrows appear. Instead, a dashed diagonal axis is drawn through AA and ATA^T, with cells above and below the axis colored differently so you can see the reflection at a glance.

Square vs Rectangular Matrices

The diagonal reflection method behaves differently for square and non-square AA, and the visualizer makes this explicit.

• For a square matrix (m=nm = n), the main diagonal is a real geometric line. Reflection across it swaps ai,ja_{i,j} with aj,ia_{j,i} and fixes the diagonal entries in place
• For a rectangular matrix (m≠nm \neq n), a strict main diagonal only extends through the min⁡(m,n)×min⁡(m,n)\min(m,n) \times \min(m,n) subregion. The visualizer draws a diagonal-like reflection axis through that subregion and explains that the swap rule still applies to every cell, including those in the overhang

Try a 3×43 \times 4 matrix with the diagonal reflection method to see the abstract axis, then switch to 3×33 \times 3 to see the true diagonal.

What the Transpose Is

The transpose of an m×nm \times n matrix AA is the n×mn \times m matrix ATA^T defined by the row-column swap:

(AT)i,j=aj,i\left(A^T\right)_{i,j} = a_{j,i}


Geometrically, transposition is reflection across the main diagonal. Algebraically, it converts row vectors into column vectors and vice versa. The shape always flips: if AA is wide, ATA^T is tall, and vice versa.

Transpose has no shape restrictions — any matrix can be transposed, unlike addition (which requires matched shapes) or multiplication (which requires compatible inner dimensions).

For comprehensive coverage of matrix operations theory, see matrix operations.

Key Properties

Transpose satisfies several algebraic identities that are central to linear algebra.

• Involution: (AT)T=A(A^T)^T = A — transposing twice returns the original
• Sum: (A+B)T=AT+BT(A + B)^T = A^T + B^T — transpose distributes over addition
• Scalar multiplication: (kA)T=kAT(kA)^T = k A^T — scalars pass through
• Product (order reverses): (AB)T=BTAT(AB)^T = B^T A^T — note the swap, which mirrors how shape compatibility flips
• Inverse and transpose commute: (A−1)T=(AT)−1(A^{-1})^T = (A^T)^{-1} for invertible AA
• Determinant invariance: det⁡(AT)=det⁡(A)\det(A^T) = \det(A) for square AA

The product rule is the trickiest: (AB)T≠ATBT(AB)^T \neq A^T B^T in general. The order must reverse.

Symmetric and Skew-Symmetric Matrices

Two important classes of square matrices are defined entirely through the transpose.

A matrix is symmetric if A=ATA = A^T, meaning ai,j=aj,ia_{i,j} = a_{j,i} for all i,ji, j. Symmetric matrices have all the properties one would expect from "matrices that look the same after a mirror reflection": real eigenvalues, orthogonal eigenvectors, and a guaranteed orthogonal diagonalization.

A matrix is skew-symmetric (or antisymmetric) if AT=−AA^T = -A, meaning ai,j=−aj,ia_{i,j} = -a_{j,i}. Skew-symmetric matrices have zeros on the main diagonal, since ai,i=−ai,ia_{i,i} = -a_{i,i} forces ai,i=0a_{i,i} = 0.

Every square matrix decomposes uniquely into a symmetric and skew-symmetric part: A=12(A+AT)+12(A−AT)A = \frac{1}{2}(A + A^T) + \frac{1}{2}(A - A^T).

Worked Example

Take AA as a 2×32 \times 3 matrix:

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


Then ATA^T is 3×23 \times 2, with rows and columns swapped:

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


Reading off the rule: a1,1=1a_{1,1} = 1 stays at position (1,1)(1,1) — it sits on the would-be diagonal. The entry a1,2=2a_{1,2} = 2 moves to position (2,1)(2,1) of ATA^T. The entry a2,3=6a_{2,3} = 6 moves to position (3,2)(3,2) of ATA^T.

Set the visualizer to a 2×32 \times 3 shape and try each method to see this transformation animated four different ways.

Common Mistakes

Transpose is a simple operation, but a few mistakes recur.

• Forgetting the order reverses in a product — (AB)T=BTAT(AB)^T = B^T A^T, not ATBTA^T B^T. The swap is essential and follows from shape compatibility
• Confusing transpose with inverse — ATA^T and A−1A^{-1} are different operations; they coincide only for orthogonal matrices, where AT=A−1A^T = A^{-1}
• Assuming the diagonal is preserved for rectangular matrices — there is no true diagonal when m≠nm \neq n, only a diagonal-like axis through the square subregion
• Confusing transpose with conjugate transpose — for complex matrices, the conjugate transpose (or Hermitian transpose) A∗A^* also conjugates each entry. For real matrices the two coincide
• Writing ATA^T when the matrix isn't named AA — the notation MTM^T, XTX^T, etc., uses whatever symbol names the matrix