Reverse
Examples
open all close allBasic Examples (2)
Reverse the elements of a list:
Reverse[{a, b, c, d}]Reverse an Association:
Reverse[<|a -> 1, b -> 2, c -> 2|>]Scope (3)
Reverse works with heads other than List:
Reverse[f[a, b, c]]Reverse the order of sublists, keeping each sublist unchanged:
Reverse[{{a, b, c}, {d, e, f}}, 1]Reverse the of sublist contents, keeping the order of sublists unchanged:
Reverse[{{a, b, c}, {d, e, f}}, 2]Reverse both the order of sublists and their contents:
Reverse[{{a, b, c}, {d, e, f}}, {1, 2}]Reverse an Association on the first and second levels:
Reverse[<|a :> {1, 2}, b -> {3, 4}, c -> {5, 6}|>, {1, 2}]Applications (2)
Reverse operands:
Reverse[a.b.c.d.e]Turn an array plot upside down:
ArrayPlot[Reverse[CellularAutomaton[30, {{1}, 0}, 20]]]Properties & Relations (4)
Reverse is its own inverse:
Reverse[Reverse[{a, b, c, d}]]For a matrix m, Reverse[m] reverses the rows:
m = (| | | |
| - | - | - |
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 9 |);Reverse[m]//MatrixFormReverse[m,2] reverses the columns:
Reverse[m, 2]//MatrixFormReverse[m,{1,2}] reverses both rows and columns:
Reverse[m, {1, 2}]//MatrixFormReverse[expr,n] is equivalent to Map[Reverse,expr,{n-1}]:
Reverse[Array[a, {5, 5, 5}], 3] == Map[Reverse, Array[a, {5, 5, 5}], {2}]Reverse[Array[a, {5, 5, 5}], 1] == Map[Reverse, Array[a, {5, 5, 5}], {0}]Since the default level for Map is {1}, the third argument is unnecessary for n==2:
Reverse[{{a, b, c}, {d, e, f}}, 2] == Map[Reverse, {{a, b, c}, {d, e, f}}]Reverse[expr,Range[n]] is equivalent to Map[Reverse,expr,{0,n-2}]:
Reverse[Array[a, {5, 5, 5}], Range[3]] == Map[Reverse, Array[a, {5, 5, 5}], {0, 2}]Tech Notes
Related Guides
History
Introduced in 1988 (1.0) | Updated in 2003 (5.0) ▪ 2007 (6.0)
Text
Wolfram Research (1988), Reverse, Wolfram Language function, https://reference.wolfram.com/language/ref/Reverse.html (updated 2007).
CMS
Wolfram Language. 1988. "Reverse." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/Reverse.html.
APA
Wolfram Language. (1988). Reverse. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Reverse.html
BibTeX
@misc{reference.wolfram_2026_reverse, author="Wolfram Research", title="{Reverse}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Reverse.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_reverse, organization={Wolfram Research}, title={Reverse}, year={2007}, url={https://reference.wolfram.com/language/ref/Reverse.html}, note=[Accessed: 12-June-2026]}