Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
Transpose
  • See Also
    • Flatten
    • Thread
    • ConjugateTranspose
    • TensorTranspose
    • Tr
    • TwoWayRule
    • Cycles
    • Reverse
    • ArrayReshape
    • ArrayReduce

    • Characters
    • \[Transpose]
  • Related Guides
    • Rearranging & Restructuring Lists
    • Matrix Operations
    • Tensors
    • Parts of Matrices
    • GPU Computing
    • List Manipulation
    • Matrices and Linear Algebra
    • Handling Arrays of Data
    • Basic Image Manipulation
    • Symbolic Vectors, Matrices and Arrays
    • GPU Computing with NVIDIA
    • Graph Programming
    • Structural Operations on Expressions
  • Tech Notes
    • Vectors and Matrices
    • Rearranging Nested Lists
    • Nested Lists
    • Getting and Setting Pieces of Matrices
    • Basic Matrix Operations
    • Tensors
    • See Also
      • Flatten
      • Thread
      • ConjugateTranspose
      • TensorTranspose
      • Tr
      • TwoWayRule
      • Cycles
      • Reverse
      • ArrayReshape
      • ArrayReduce

      • Characters
      • \[Transpose]
    • Related Guides
      • Rearranging & Restructuring Lists
      • Matrix Operations
      • Tensors
      • Parts of Matrices
      • GPU Computing
      • List Manipulation
      • Matrices and Linear Algebra
      • Handling Arrays of Data
      • Basic Image Manipulation
      • Symbolic Vectors, Matrices and Arrays
      • GPU Computing with NVIDIA
      • Graph Programming
      • Structural Operations on Expressions
    • Tech Notes
      • Vectors and Matrices
      • Rearranging Nested Lists
      • Nested Lists
      • Getting and Setting Pieces of Matrices
      • Basic Matrix Operations
      • Tensors

Transpose[list]

transposes the first two levels in list.

Transpose[list,{n1,n2,…}]

transposes list so that the k^(th) level in list is the nk^(th) level in the result.

Transpose[list,mn]

transposes levels m and n in list, leaving all other levels unchanged.

Transpose[list,k]

cycles the levels in list k positions to the right.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Matrices  
Arrays  
Applications  
Matrix Decompositions  
Special Matrices  
Visualization  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Tech Notes
Related Guides
Related Links
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • Flatten
    • Thread
    • ConjugateTranspose
    • TensorTranspose
    • Tr
    • TwoWayRule
    • Cycles
    • Reverse
    • ArrayReshape
    • ArrayReduce

    • Characters
    • \[Transpose]
  • Related Guides
    • Rearranging & Restructuring Lists
    • Matrix Operations
    • Tensors
    • Parts of Matrices
    • GPU Computing
    • List Manipulation
    • Matrices and Linear Algebra
    • Handling Arrays of Data
    • Basic Image Manipulation
    • Symbolic Vectors, Matrices and Arrays
    • GPU Computing with NVIDIA
    • Graph Programming
    • Structural Operations on Expressions
  • Tech Notes
    • Vectors and Matrices
    • Rearranging Nested Lists
    • Nested Lists
    • Getting and Setting Pieces of Matrices
    • Basic Matrix Operations
    • Tensors
    • See Also
      • Flatten
      • Thread
      • ConjugateTranspose
      • TensorTranspose
      • Tr
      • TwoWayRule
      • Cycles
      • Reverse
      • ArrayReshape
      • ArrayReduce

      • Characters
      • \[Transpose]
    • Related Guides
      • Rearranging & Restructuring Lists
      • Matrix Operations
      • Tensors
      • Parts of Matrices
      • GPU Computing
      • List Manipulation
      • Matrices and Linear Algebra
      • Handling Arrays of Data
      • Basic Image Manipulation
      • Symbolic Vectors, Matrices and Arrays
      • GPU Computing with NVIDIA
      • Graph Programming
      • Structural Operations on Expressions
    • Tech Notes
      • Vectors and Matrices
      • Rearranging Nested Lists
      • Nested Lists
      • Getting and Setting Pieces of Matrices
      • Basic Matrix Operations
      • Tensors

Transpose

Transpose[list]

transposes the first two levels in list.

Transpose[list,{n1,n2,…}]

transposes list so that the k^(th) level in list is the nk^(th) level in the result.

Transpose[list,mn]

transposes levels m and n in list, leaving all other levels unchanged.

Transpose[list,k]

cycles the levels in list k positions to the right.

Details and Options

  • Transpose[m] gives the usual transpose of a matrix m.
  • Transpose[m] can be input as m.
  •  can be entered as tr or \[Transpose].
  • Transpose[m] formats as in StandardForm and TraditionalForm. »
  • For a matrix m, Transpose[m] is equivalent to Transpose[m,{2,1}].
  • For an array a of depth r≥3, Transpose[a] is equivalent to Transpose[a,{2,1,3,…,r}], only transposing the first two levels. »
  • The ni in Transpose[a,{n1,n2,…}] or Transpose[a,n1n2] must be positive integers no larger than ArrayDepth[a].
  • If {n1,n2,…} is a permutation list, then the element at position {i1,i2,…} of Transpose[a,{n1,n2,…}] is the element at position {in1,in2,…} of the array a.
  • For a permutation perm, the dimensions of Transpose[a,perm] are Permute[Dimensions[a],perm].
  • A permutation list perm in Transpose[a,perm] can also be given in Cycles form, as returned by PermutationCycles[perm]. »
  • Transpose[a,m↔n] or Transpose[a,TwoWayRule[m,n]] is equivalent to Transpose[a,Cycles[{{m,n}}]]. »
  • Transpose[a,k] is equivalent to Transpose[a,RotateLeft[Range[n],k]], where n is the depth of a.
  • Transpose allows the ni to be repeated, computing diagonals of the subarrays determined by the repeated levels. The result is therefore an array of smaller depth.
  • For a square matrix m, Transpose[m,{1,1}] returns the main diagonal of m, as given by Diagonal[m]. »
  • In general, if np=nq then the operation Transpose[a,{n1,n2,…}] is possible for an array a of dimensions {d1,d2,…} if dp=dq.
  • Transpose works on SparseArray and structured array objects.

Examples

open all close all

Basic Examples  (4)

Transpose a 3×3 numerical matrix:

Wolfram Language code: m = {{3, 4, 1}, {2, 3, 1}, {5, 4, 2}}; mt = Transpose[m]

Visualize the transposition operation:

Wolfram Language code: GraphicsRow[{MatrixPlot[m], MatrixPlot[mt]}, ImageSize -> Medium]

Transpose a 2×3 symbolic matrix:

Wolfram Language code: Transpose[(⁠| | | | | - | - | - | | a | b | c | | x | y | z |⁠)]//MatrixForm

Use followed by tr to enter the transposition operator:

Wolfram Language code: {{a, x}, {b, y}, {c, z}}^

Output formatting:

Wolfram Language code: Transpose[m]

Scope  (12)

Matrices  (5)

Enter a matrix as a grid:

Wolfram Language code: m = (| | | | - | - | | 1 | 2 | | 3 | 4 |)

Transpose the matrix and format the result:

Wolfram Language code: MatrixForm[Transpose[m]]

Transpose a row matrix into a column matrix:

Wolfram Language code: r = {{1.5, 2.2, 3.1}}; c = Transpose[r]

Format the input and output:

Wolfram Language code: {r//MatrixForm, c//MatrixForm}

Transpose the column matrix back into a row matrix:

Wolfram Language code: Transpose[c]

Transposition of a vector leaves it unchanged:

Wolfram Language code: Transpose[{1.5, 2.2, 3.1}]

Transpose leaves the identity matrix unchanged:

Wolfram Language code: Transpose[IdentityMatrix[3]]//MatrixForm

s is a sparse matrix:

Wolfram Language code: s = SparseArray[{{1, 1} -> 1, {2, 3} -> 4, {3, 1} -> -1}]

Transpose[s] is also sparse:

Wolfram Language code: Transpose[s]

The indices have, in effect, just been reversed:

Wolfram Language code: ArrayRules[%]

Transpose a SymmetrizedArray object:

Wolfram Language code: sa = SymmetrizedArray[_ :> RandomInteger[20], {10, 10}, Antisymmetric[{1, 2}]]
Wolfram Language code: Transpose[sa]

The result equals the negative of the original array, due to its antisymmetry:

Wolfram Language code: % === -sa

Arrays  (7)

Transpose the first two levels of a rank-3 array, effectively transposing it as a matrix of vectors:

Wolfram Language code: a = Array[x, {2, 3, 2}]; a//MatrixForm
Wolfram Language code: Transpose[a]//MatrixForm

Transpose an array of depth 3 using different permutations:

Wolfram Language code: a = Array[c, {2, 3, 2}]
Wolfram Language code: Transpose[a, {1, 3, 2}]
Wolfram Language code: Transpose[a, {3, 2, 1}]
Wolfram Language code: Transpose[a, {2, 1, 3}]

Cycle levels of a depth-5 array two positions to the right:

Wolfram Language code: a = RandomInteger[100, {2, 3, 4, 5, 6}];
Wolfram Language code: (b = Transpose[a, 2])//Dimensions
Wolfram Language code: b === Transpose[a, {3, 4, 5, 1, 2}]

Perform transpositions using TwoWayRule notation:

Wolfram Language code: a = RandomInteger[100, {2, 3, 4, 5}];
Wolfram Language code: Transpose[a, TwoWayRule[1, 4]] === Transpose[a, {4, 2, 3, 1}]
Wolfram Language code: Transpose[a, 2  4] === Transpose[a, {1, 4, 3, 2}]

Perform transpositions using Cycles notation:

Wolfram Language code: a = RandomInteger[100, {2, 3, 4, 5}];
Wolfram Language code: Transpose[a, Cycles[{{1, 4}}]] === Transpose[a, {4, 2, 3, 1}]
Wolfram Language code: Transpose[a, Cycles[{{1, 4}, {2, 3}}]] === Transpose[a, {4, 3, 2, 1}]

Transpose levels 2 and 3 of a depth-4 array:

Wolfram Language code: a = ArrayReshape[Range[24], {1, 2, 3, 4}]
Wolfram Language code: Transpose[a, 2  3]

The second and third dimensions have been exchanged:

Wolfram Language code: Dimensions[%]

Get the leading diagonal by transposing two identical levels:

Wolfram Language code: Transpose[Array[a, {3, 3}], {1, 1}]

Applications  (13)

Matrix Decompositions  (4)

is a random real matrix:

Wolfram Language code: m = RandomReal[1, {4, 4}];

Find the QRDecomposition of :

Wolfram Language code: {q, r} = QRDecomposition[m];

is orthogonal, so its inverse is TemplateBox[{q}, Transpose]:

Wolfram Language code: Chop[q.q]

Reconstruct from the decomposition:

Wolfram Language code: q.r - m//Chop

Compute the SchurDecomposition of a matrix :

Wolfram Language code: m = {{1.5, 1}, {2.3, -2.5}};
Wolfram Language code: {q, t} = SchurDecomposition[m];

The matrix is orthogonal, so its inverse is TemplateBox[{q}, Transpose]:

Wolfram Language code: Chop[q.Transpose[q]]

Reconstruct from the decomposition:

Wolfram Language code: m - q.t.Transpose[q]//Chop

Compute the SingularValueDecomposition of a matrix :

Wolfram Language code: m = {{1, 1}, {2, 3}};
Wolfram Language code: {u, Σ, v} = SingularValueDecomposition[m];

The matrices and are orthogonal, so their inverses are their transposes:

Wolfram Language code: MatrixForm /@ FullSimplify[{u.u, v.v}]

Reconstruct from the decomposition:

Wolfram Language code: m == u.Σ.Transpose[v]//FullSimplify

Construct the singular value decomposition of , a random matrix:

Wolfram Language code: dims = {3, 5}; m = RandomReal[1, dims];

First compute the eigensystem of TemplateBox[{a}, Transpose].a:

Wolfram Language code: {λ, vvecs} = Eigensystem[m.m];

The singular values are the square roots of the nonzero eigenvalues:

Wolfram Language code: s = Sqrt[DeleteCases[Chop[λ], 0]]

The matrix is a diagonal matrix of singular values with the same shape as :

Wolfram Language code: Σ = DiagonalMatrix[s, 0, dims]; MatrixForm[Chop[Σ]]

The matrix has the eigenvectors as its columns:

Wolfram Language code: v = Transpose[vvecs];

The matrix has columns of the form for each of the nonzero eigenvalues:

Wolfram Language code: u = m.Transpose[(Take[vvecs, Length[s]]/s)];

Verify that and are orthogonal:

Wolfram Language code: u.u//Chop
Wolfram Language code: v.v//Chop

Verify the decomposition:

Wolfram Language code: u.Σ.v - m//Chop

Special Matrices  (6)

A symmetric matrix obeys s=TemplateBox[{s}, Transpose], an antisymmetric matrix a=-TemplateBox[{a}, Transpose]. This matrix is symmetric:

Wolfram Language code: s = (| | | | | - | - | - | | 1 | 2 | 3 | | 2 | 4 | 5 | | 3 | 5 | 6 |);
Wolfram Language code: s == Transpose[s]

Confirm with SymmetricMatrixQ:

Wolfram Language code: SymmetricMatrixQ[s]

This matrix is antisymmetric:

Wolfram Language code: a = (| | | | | -- | -- | - | | 0 | 1 | 2 | | -1 | 0 | 3 | | -2 | -3 | 0 |);
Wolfram Language code: a == -Transpose[a]

Confirm with AntisymmetricMatrixQ:

Wolfram Language code: AntisymmetricMatrixQ[a]

A matrix is orthogonal if TemplateBox[{o}, Inverse]=TemplateBox[{o}, Transpose]. Check if the matrix is orthogonal:

Wolfram Language code: o = {{(1/2), -(Sqrt[3]/2)}, {(Sqrt[3]/2), (1/2)}};
Wolfram Language code: o.o == o.o == IdentityMatrix[2]

Confirm that it is orthogonal using OrthogonalMatrixQ:

Wolfram Language code: OrthogonalMatrixQ[o]

A real-valued symmetric matrix is orthogonally diagonalizable as s=o.d.TemplateBox[{o}, Transpose], with diagonal and real valued and orthogonal. Verify that the following matrix is symmetric and then diagonalize it:

Wolfram Language code: (s = {{1, 4, -2}, {4, 0, -3}, {-2, -3, 2}})//MatrixForm
Wolfram Language code: Transpose[s] == s

To diagonalize, first compute 's eigenvalues and place them in a diagonal matrix:

Wolfram Language code: d = DiagonalMatrix[Eigenvalues[s]]

Next, compute the unit eigenvectors:

Wolfram Language code: v = FullSimplify[Normalize /@ Eigenvectors[s]]

Then can be diagonalized with as previously, and o=TemplateBox[{v}, Transpose]:

Wolfram Language code: o = Transpose[v]; s == o.d.Transpose[o]

A matrix is unitary if TemplateBox[{u}, Inverse]=TemplateBox[{{(, TemplateBox[{u}, Transpose, SyntaxForm -> SuperscriptBox], )}}, Conjugate]. Show that the matrix is unitary:

Wolfram Language code: u = {{(1/Sqrt[2]), (I/Sqrt[2])}, {(I/Sqrt[2]), (1/Sqrt[2])}};
Wolfram Language code: Inverse[u] == Conjugate[Transpose[u]]

Confirm with UnitaryMatrixQ:

Wolfram Language code: UnitaryMatrixQ[u]

A real-valued matrix is called normal if n.TemplateBox[{n}, Transpose]=TemplateBox[{n}, Transpose].n. Normal matrices are the most general kind of matrix that can be unitarily diagonalized as n=u.d.TemplateBox[{{(, TemplateBox[{u}, Transpose, SyntaxForm -> SuperscriptBox], )}}, Conjugate] with diagonal and unitary. All real symmetric matrices are normal because both sides of the equality are simply :

Wolfram Language code: TensorReduce[Transpose[s].s == s.Transpose[s] == s.s, Assumptions -> s∈Matrices[{n, n}, Reals, Symmetric[{1, 2}]]]

Show that the following matrix is normal and then diagonalize it:

Wolfram Language code: (n = {{3, -1}, {1, 3}})//MatrixForm
Wolfram Language code: n.Transpose[n] == Transpose[n].n

Confirm using NormalMatrixQ:

Wolfram Language code: NormalMatrixQ[n]

A normal matrix like can be unitarily diagonalized using Eigensystem:

Wolfram Language code: {λ, v} = Eigensystem[{n}]

Unlike the case of a symmetric matrix, the diagonal matrix here is complex valued:

Wolfram Language code: (d = DiagonalMatrix[λ])//MatrixForm

Normalizing the eigenvectors and putting them in columns gives a unitary matrix:

Wolfram Language code: u = Transpose[Normalize /@ v]; UnitaryMatrixQ[u]

Confirm the diagonalization n=u.d.TemplateBox[{{(, TemplateBox[{u}, Transpose, SyntaxForm -> SuperscriptBox], )}}, Conjugate]:

Wolfram Language code: n == u.d.Conjugate[Transpose[u]]

Show that real antisymmetric matrices and orthogonal matrices are normal and thus can be unitarily diagonalized. For orthogonal matrices, simply substitute in the definition TemplateBox[{o}, Transpose]=TemplateBox[{o}, Inverse] to get the identity matrix on both sides:

Wolfram Language code: TensorReduce[o.Transpose[o] == Transpose[o].o /. Transpose[o] -> Inverse[o], Assumptions -> o∈Matrices[{n, n}, Reals]]

For an antisymmetric matrix, both sides are simply :

Wolfram Language code: TensorReduce[Transpose[a].a == a.Transpose[a] == -a.a, Assumptions -> a∈Matrices[{n, n}, Reals, Antisymmetric[{1, 2}]]]

Orthogonal matrices have eigenvalues that lie on the unit circle:

Wolfram Language code: o = {{(1 + Sqrt[3]/2 Sqrt[2]), -(-1 + Sqrt[3]/2 Sqrt[2])}, {(-1 + Sqrt[3]/2 Sqrt[2]), (1 + Sqrt[3]/2 Sqrt[2])}}; OrthogonalMatrixQ[o]
Wolfram Language code: Abs /@ Eigenvalues[o]//FullSimplify

Antisymmetric matrices have pure imaginary eigenvalues:

Wolfram Language code: a = {{0, 1, 2}, {-1, 0, 3}, {-2, -3, 0}}; AntisymmetricMatrixQ[a]
Wolfram Language code: Eigenvalues[a]

Visualization  (3)

Use Transpose to change data grouping in BarChart:

Wolfram Language code: data = {{7, 5, 8}, {4, 6, 5}};
Wolfram Language code: BarChart[data, ChartLabels -> {{"Male", "Female"}, {"Cats", "Dogs", "Fish"}}]
Wolfram Language code: BarChart[Transpose[data], ChartLabels -> {{"Cats", "Dogs", "Fish"}, {"Male", "Female"}}]

Use Transpose to swap the and axes in ListPlot3D:

Wolfram Language code: data = Table[ Sin[i + j ^ 2], {i, -2, 3, 0.1}, {j, -3, 2, 0.1}];
Wolfram Language code: plot = ListPlot3D[data]
Wolfram Language code: ListPlot3D[Transpose[data]]

This has the effect of reflecting the data across the line :

Wolfram Language code: MapAt[GeometricTransformation[#, ReflectionTransform[{1, -1, 0}]]&, plot, 1]

Multidimensionalize (in the tensor product sense) a one-dimensional list command:

Wolfram Language code: Multidimensionalize[f1d_][x_] := Module[{n, p, res = x}, n = ArrayDepth[x]; p = RotateRight[Range[n]]; Do[ res = Map[f1d, res, {n - 1}]; res = Transpose[res, p], {n}]; res ]

For example, accumulate at all levels of an array:

Wolfram Language code: Multidimensionalize[Accumulate][{{{1, 2}, {3, 4}, {5, 6}}, {{a, b}, {c, d}, {e, f}}}]

Reverse at all levels of an array:

Wolfram Language code: Multidimensionalize[Reverse][{{{1, 2}, {3, 4}, {5, 6}}, {{a, b}, {c, d}, {e, f}}}]

Import an RGB image:

Wolfram Language code: img = ExampleData[{"TestImage", "JellyBeans"}]

Reverse the data at all levels, reflecting across the line and swapping red and blue channels:

Wolfram Language code: Image[Multidimensionalize[Reverse][ImageData[img]]]

Properties & Relations  (18)

Transpose obeys TemplateBox[{{(, TemplateBox[{A}, Transpose, SyntaxForm -> SuperscriptBox], )}}, Transpose]=A:

Wolfram Language code: a = RandomReal[1, {3, 3}]; Transpose[Transpose[a]] == a

For compatible matrices and , Transpose obeys TemplateBox[{{(, {a, ., b}, )}}, Transpose]=TemplateBox[{b}, Transpose].TemplateBox[{a}, Transpose]:

Wolfram Language code: a = RandomReal[1, {3, 4}]; b = RandomReal[1, {4, 5}]; Transpose[a.b] == Transpose[b].Transpose[a]

Matrix inversion commutes with Transpose, i.e. TemplateBox[{{(, TemplateBox[{a}, Transpose], )}}, Inverse]=TemplateBox[{{(, TemplateBox[{a}, Inverse], )}}, Transpose]:

Wolfram Language code: a = {{-(1/25), (12/25), -(7/25)}, {-(7/25), (9/25), (1/25)}, {(13/75), -(31/75), (16/75)}};
Wolfram Language code: Inverse[Transpose[a]] == Transpose[Inverse[a]]

Conjugate[Transpose[m]] can be done in a single step with ConjugateTranspose:

Wolfram Language code: m = {{1 + 2I, 3 - 4I}, {-5 - 6I, -7 + 8I}};
Wolfram Language code: Conjugate[Transpose[m]]
Wolfram Language code: ConjugateTranspose[m]

Many special matrices are defined by their properties under Transpose. A symmetric matrix has TemplateBox[{s}, Transpose]=s:

Wolfram Language code: s = (| | | | - | - | | a | b | | b | c |); {Transpose[s] == s, SymmetricMatrixQ[s]}

An orthogonal matrix satisfies TemplateBox[{o}, Transpose]=TemplateBox[{o}, Inverse]:

Wolfram Language code: o = (⁠| | | | ----------- | ----------- | | (Sqrt[3]/2) | -(1/2) | | (1/2) | (Sqrt[3]/2) |⁠); {Transpose[o] == Inverse[o], OrthogonalMatrixQ[o]}

The product of a matrix and its transpose is symmetric:

Wolfram Language code: m = RandomReal[1, {3, 4}];

is the matrix product of and :

Wolfram Language code: s = m.m;

TemplateBox[{s}, Transpose]=TemplateBox[{{(, {TemplateBox[{m}, Transpose], ., m}, )}}, Transpose]=TemplateBox[{m}, Transpose].TemplateBox[{{(, TemplateBox[{m}, Transpose, SyntaxForm -> SuperscriptBox], )}}, Transpose]=TemplateBox[{m}, Transpose]m=s, so is symmetric

Wolfram Language code: s == s

The sum of a square matrix and its transpose is symmetric:

Wolfram Language code: m = RandomReal[1, {4, 4}];

is the matrix sum of and TemplateBox[{m}, Transpose]:

Wolfram Language code: s = m + m;

TemplateBox[{s}, Transpose]=TemplateBox[{{(, {TemplateBox[{m}, Transpose, SyntaxForm -> SuperscriptBox], +, m}, )}}, Transpose]=TemplateBox[{m}, Transpose]+TemplateBox[{{(, TemplateBox[{m}, Transpose, SyntaxForm -> SuperscriptBox], )}}, Transpose]=TemplateBox[{m}, Transpose]+m=s, so is symmetric:

Wolfram Language code: s == s

The difference is antisymmetric:

Wolfram Language code: a = m - m; a == -a

Transposition of {{}} returns {}:

Wolfram Language code: Transpose[{{}}]

The result cannot be {{}} again because the permutation of the dimensions {1,0} is {0,1} and no expression can have dimensions {0,1}:

Wolfram Language code: Dimensions[{{}}]

Transpose[a] transposes the first two levels of an array:

Wolfram Language code: a = RandomInteger[10, {5, 6, 7}];
Wolfram Language code: Transpose[a] == Transpose[a, {2, 1, 3}] == Transpose[a, 1 <-> 2]

Transpose[a,perm] returns an array of dimensions Permute[Dimensions[a],perm]:

Wolfram Language code: a = RandomInteger[10, {2, 3, 4, 5}];
Wolfram Language code: perm = RandomSample[Range[4]]
Wolfram Language code: Dimensions[Transpose[a, perm]]
Wolfram Language code: Permute[Dimensions[a], perm]

Take an array with dimensions {2,3,4}:

Wolfram Language code: a = RandomInteger[10, {2, 3, 4}];

Transposing by a permutation σ transposes the element positions by σ-1:

Wolfram Language code: σ = RandomSample[Range[3]]
Wolfram Language code: σi = InversePermutation[σ]
Wolfram Language code: Extract[a, {1, 3, 1}] == Extract[Transpose[a, σ], {1, 3, 1}[[σi]]]

Transpose[a,Cycles[{{m,n}}]] and Transpose[a,mn] are equivalent:

Wolfram Language code: a = RandomInteger[10, {2, 3, 4, 5}];
Wolfram Language code: Transpose[a, Cycles[{{2, 3}}]] == Transpose[a, 2  3]

Both forms are equivalent to using PermutationList[Cycles[{{m,n}}]]:

Wolfram Language code: perm = PermutationList[Cycles[{{2, 3}}]]
Wolfram Language code: Transpose[a, Cycles[{{2, 3}}]] == Transpose[a, perm]

Composition of transpositions is equivalent to a product of their permutations, in the same order:

Wolfram Language code: a = Array[x, {2, 3, 4, 5}];
Wolfram Language code: perm1 = {4, 1, 2, 3};
Wolfram Language code: perm2 = {2, 4, 3, 1};
Wolfram Language code: Transpose[Transpose[a, perm1], perm2] === Transpose[a, perm1perm2]

Transpositions do not commute, in general:

Wolfram Language code: Transpose[Transpose[a, perm1], perm2] === Transpose[Transpose[a, perm2], perm1]

Transpose[a,σ] is equivalent to Flatten[a,List/@InversePermutation[σ]]:

Wolfram Language code: a = Array[x, {2, 3, 4, 5}];
Wolfram Language code: perm = RandomSample[Range[4]]
Wolfram Language code: Transpose[a, perm] === Flatten[a, List /@ InversePermutation[perm]]

Transpose and TensorTranspose coincide on explicit arrays:

Wolfram Language code: a = Array[x, {5, 6, 7, 8}];
Wolfram Language code: Transpose[a, {2, 4, 3, 1}] == TensorTranspose[a, {2, 4, 3, 1}]

TensorTranspose further supports symbolic operations that Transpose does not:

Wolfram Language code: TensorTranspose[TensorTranspose[T, {2, 4, 3, 1}], {2, 4, 3, 1}]
Wolfram Language code: Transpose[Transpose[T, {2, 4, 3, 1}], {2, 4, 3, 1}]

Transposition of a matrix can also be performed with Thread:

Wolfram Language code: m = Array[x, {3, 4}]
Wolfram Language code: Transpose[m] === Thread[m]

Transpose[m,{1,1}] is equivalent to Diagonal[m]:

Wolfram Language code: m = RandomReal[1, {4, 4}];
Wolfram Language code: Transpose[m, {1, 1}]
Wolfram Language code: Diagonal[m]

Transpose[a,{1,…,1,2,3,…}] is equivalent to tracing the levels being transposed to level 1:

Wolfram Language code: a = Array[x, {2, 2, 2, 2, 2}];
Wolfram Language code: Transpose[a, {1, 1, 1, 2, 3}] === Tr[a, List, 3]

Possible Issues  (1)

Transpose only works for rectangular arrays:

Wolfram Language code: Transpose[{{1, 2, 3, 4}, {5}, {6, 7}}]

Generalize transposition by padding:

Wolfram Language code: Transpose[PadRight[{{1, 2, 3, 4}, {5}, {6, 7}}, {3, 4}, p]]

Eliminate the padding:

Wolfram Language code: % /. p -> Sequence[]

Neat Examples  (1)

Wolfram Language code: MatrixForm[Transpose[{{{{x, x, x, x}}}}, #]]& /@ Permutations[{1, 2, 3, 4}]

See Also

Flatten  Thread  ConjugateTranspose  TensorTranspose  Tr  TwoWayRule  Cycles  Reverse  ArrayReshape  ArrayReduce

Characters: \[Transpose]

Function Repository: AssociationTranspose

Tech Notes

    ▪
  • Vectors and Matrices
  • ▪
  • Rearranging Nested Lists
  • ▪
  • Nested Lists
  • ▪
  • Getting and Setting Pieces of Matrices
  • ▪
  • Basic Matrix Operations
  • ▪
  • Tensors

Related Guides

    ▪
  • Rearranging & Restructuring Lists
  • ▪
  • Matrix Operations
  • ▪
  • Tensors
  • ▪
  • Parts of Matrices
  • ▪
  • GPU Computing
  • ▪
  • List Manipulation
  • ▪
  • Matrices and Linear Algebra
  • ▪
  • Handling Arrays of Data
  • ▪
  • Basic Image Manipulation
  • ▪
  • Symbolic Vectors, Matrices and Arrays
  • ▪
  • GPU Computing with NVIDIA
  • ▪
  • Graph Programming
  • ▪
  • Structural Operations on Expressions

Related Links

  • An Elementary Introduction to the Wolfram Language : Rearranging Lists
  • NKS|Online  (A New Kind of Science)

History

Introduced in 1988 (1.0) | Updated in 2003 (5.0) ▪ 2004 (5.1) ▪ 2012 (9.0) ▪ 2017 (11.2) ▪ 2024 (14.1) ▪ 2025 (14.3)

Wolfram Research (1988), Transpose, Wolfram Language function, https://reference.wolfram.com/language/ref/Transpose.html (updated 2025).

Text

Wolfram Research (1988), Transpose, Wolfram Language function, https://reference.wolfram.com/language/ref/Transpose.html (updated 2025).

CMS

Wolfram Language. 1988. "Transpose." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/Transpose.html.

APA

Wolfram Language. (1988). Transpose. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Transpose.html

BibTeX

@misc{reference.wolfram_2026_transpose, author="Wolfram Research", title="{Transpose}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/Transpose.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_transpose, organization={Wolfram Research}, title={Transpose}, year={2025}, url={https://reference.wolfram.com/language/ref/Transpose.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English