How to Find the Transpose of a Matrix, Step by Step

Finding the transpose of a matrix means swapping its rows and columns. Take each row of the original matrix and write it as a column instead. If your matrix has 3 rows and 2 columns (a 3×2 matrix), its transpose will have 2 rows and 3 columns (a 2×3). The process is straightforward once you see it in action.

The Core Idea: Reflect Across the Diagonal

Visually, transposing a matrix is like mirroring it across its main diagonal, the line running from the top-left corner to the bottom-right. Every element at position (row i, column j) moves to position (row j, column i). The first row becomes the first column, the second row becomes the second column, and so on.

Here’s a concrete example. Start with this 2×3 matrix:

A = [ 1 2 3 ]
    [ 4 5 6 ]

Row 1 is [1, 2, 3] and Row 2 is [4, 5, 6]. To transpose, write each row as a column:

AT = [ 1 4 ]
       [ 2 5 ]
       [ 3 6 ]

The result is a 3×2 matrix. Notice that the element in row 1, column 2 (which was 2) is now in row 2, column 1. Every element has swapped its row and column index.

Step-by-Step Method

For any matrix with m rows and n columns:

  • Step 1: Set up an empty matrix with n rows and m columns (the dimensions flip).
  • Step 2: Take the first row of the original and write it down as the first column of the new matrix.
  • Step 3: Take the second row and write it as the second column.
  • Step 4: Continue until you’ve placed every row as the corresponding column.

For a square matrix (same number of rows and columns), the dimensions stay the same. Only the off-diagonal elements change position. The elements sitting on the main diagonal don’t move at all, since their row and column indices are already equal.

Try it with a 3×3 matrix:

B = [ 1 2 3 ]
    [ 4 5 6 ]
    [ 7 8 9 ]

BT = [ 1 4 7 ]
        [ 2 5 8 ]
        [ 3 6 9 ]

The diagonal (1, 5, 9) stays put. The 2 and 4 swap places. The 3 and 7 swap. The 6 and 8 swap.

Key Properties Worth Knowing

Transposing has a handful of rules that come up constantly in linear algebra and applied math. The most important ones:

Double transpose returns the original. If you transpose a matrix and then transpose the result, you get back exactly what you started with. (AT)T = A.

Transpose of a sum. You can transpose two matrices and then add them, or add first and then transpose. The result is the same: (A + B)T = AT + BT.

Transpose of a product reverses the order. This one catches people off guard. When you transpose the product of two matrices, the order flips: (AB)T = BTAT. You transpose each matrix individually, then multiply them in reverse order. This extends to longer chains of products, always reversing the sequence.

Determinant and trace don’t change. For square matrices, the determinant of a matrix equals the determinant of its transpose. The trace (the sum of the diagonal elements) also stays the same, which makes sense since the diagonal elements never move during transposition.

Symmetric and Skew-Symmetric Matrices

Some matrices have a special relationship with their transpose. A symmetric matrix equals its own transpose: AT = A. This means the matrix is already mirrored across the diagonal. Correlation matrices and distance matrices are common real-world examples. If you see a matrix where the element in row 2, column 3 is always the same as the element in row 3, column 2, that matrix is symmetric.

A skew-symmetric matrix is the opposite case: the transpose equals the negative of the original, meaning AT = −A. Every element above the diagonal is the negative of its mirror below the diagonal, and all diagonal elements are zero. These show up in physics when representing things like angular velocity and cross products.

How to Transpose in Code and Spreadsheets

If you’re working with actual data rather than textbook problems, you’ll rarely transpose by hand.

In Python with NumPy, you have three options that all do the same thing. You can call numpy.transpose(A), use the method A.transpose(), or simply write A.T. The shorthand A.T is the most common in practice because it’s fast to type and easy to read.

In Excel, select the range of cells where you want the transposed result, type =TRANSPOSE(A1:C2) (replacing the range with your actual data), and press Ctrl+Shift+Enter (or just Enter in newer versions of Excel that support dynamic arrays). You can also copy a range, right-click where you want to paste, and choose “Transpose” from the paste options.

In MATLAB, you use the apostrophe: A' gives the transpose of A. If A contains complex numbers and you only want to swap rows and columns without taking the complex conjugate, use A.' instead.

Where Transposing Shows Up in Practice

Transposing isn’t just a classroom exercise. It’s a building block in many real calculations. One of the most common applications is in linear regression, the statistical method that fits a line (or a plane, or a hyperplane) through data points. The formula for calculating the best-fit coefficients is β = (XTX)−1XTy, where X is your data matrix and y is the outcome variable. The transpose appears twice in that single equation. As a Carnegie Mellon lecture on the topic explains, the matrix algebra handles all the bookkeeping of variances and covariances so you don’t have to track each piece individually.

Transposing also shows up when computing dot products between vectors, rotating coordinate systems, solving systems of equations, and working with neural networks (where weight matrices are constantly transposed during backpropagation). Any time you need to align dimensions for matrix multiplication, the transpose is your tool for flipping a matrix into the right shape.