Transpose a Matrix Online (Aᵀ)

Paste your matrix as rows of numbers and instantly get its transpose, where every row becomes a column and every column becomes a row. Runs entirely in your browser.

How matrix transpose works

The transpose of a matrix A is written Aᵀ and is formed by reflecting the matrix across its main diagonal. Formally, if A is an m × n matrix, then its transpose Aᵀ is an n × m matrix defined element-by-element as (Aᵀ)ij = Aji. The entry in row i, column j of the result is taken from row j, column i of the original. In plain terms: the first row of A becomes the first column of Aᵀ, the second row becomes the second column, and so on.

The algorithm this tool runs is a simple double loop. For a matrix stored as an array of rows, the transpose builds a new grid whose dimensions are flipped: result[j][i] = A[i][j] for every i from 0 to m-1 and every j from 0 to n-1. This requires the input to be rectangular — every row must hold the same number of values — otherwise the column count is ambiguous. The tool checks for this and warns you if rows have mismatched lengths.

Transposition is a fundamental operation in linear algebra. It satisfies several useful identities: (Aᵀ)ᵀ = A, (A + B)ᵀ = Aᵀ + Bᵀ, and (AB)ᵀ = BᵀAᵀ (note the reversed order). A square matrix that equals its own transpose, A = Aᵀ, is called symmetric, while A = −Aᵀ defines a skew-symmetric matrix. Transposes appear everywhere from solving least-squares systems with the normal equations AᵀAx = Aᵀb, to computing covariance matrices, dot products, and orthogonality checks. Use the Use Output as Input button to confirm that transposing twice returns your original matrix.