- Home
- Tools
- Text Tools
- Sort & Dedupe Lines
- Reverse Line Order
Reverse Line Order
Turn a list around: the last line becomes the first and the first becomes the last. Nothing inside the lines changes.
- Lines in
- 0
- Lines out
- 0
- Duplicates
- 0
What is reversed, and what isn't
- Before
- Monday: draft written Tuesday: reviewed Wednesday: corrections Thursday: published
- After
- Thursday: published Wednesday: corrections Tuesday: reviewed Monday: draft written
Only the order of the lines changes. The text inside each line is left exactly as it is, including spaces at its start and end, and empty lines stay in as lines of their own. A list with a blank line between two blocks comes back with the blocks swapped and the blank line still between them.
A line break at the very end of the text does not count as an extra, empty line. Otherwise every reversed file would start with a blank line.
Typical uses are turning a log or a changelog from oldest-first into newest-first, reading a ranking from the bottom up, or undoing a sort from high to low.
Two things that are close, and different:
- To reverse the letters, as in "olleH", use Reverse Text.
- To sort from Z to A, choose that under Order. Reversing only turns the existing order around, it doesn't sort.
Sorting, removing duplicates, numbering and adding a prefix can be combined on the Sort & Dedupe Lines page, which also remembers your settings.