Reverse the order of lines

Turn a list upside down: the last line becomes the first, and the first becomes the last. The text is processed in your browser and nothing is uploaded, so you can use it on logs and customer lists.

How it works

  1. Paste your text

    Type or paste the text in the left box, or open a .txt file. No text to hand? Click Example.

  2. Instant result

    The result appears as you type. Change the options and see straight away what changes.

  3. Copy or download

    Copy the result with one click, save it as a file or use it as input for a next step.

Example

First line, Second line, an empty line and Fourth line become Fourth line, an empty line, Second line and First line. With Leave out empty lines ticked, the empty line is dropped as well.

When it helps

  • Newest first: log files, change lists and exports that put the oldest entry on top.
  • Countdowns: a list from 1 to 10 turns into a list from 10 to 1.
  • Stacks and undo order: reverse a list of steps to see the order for undoing them.
  • Bottom-up reading: chat transcripts that are exported in the wrong direction.

Reverse is not sort

Reversing only flips the current order. To order the lines alphabetically, use sort text alphabetically, which can also sort Z to A. To flip the characters in each line instead, use reverse text, and to tidy the gaps first, remove empty lines.

Frequently asked questions

Does this reverse the letters in each line?

No. It only changes the order of the lines; each line stays as it is. To reverse the letters of the text, use [reverse text](/en/text/reverse-text).

What happens to blank lines?

They are reversed along with the other lines, so a blank line between two lines stays between them. Tick *Leave out empty lines* to drop them.

How can I show the newest log entry first?

Log files and exports usually list the oldest entry first. Paste them here and the newest line comes out on top.

Is there a limit on the number of lines?

No fixed limit. Very long lists take a little longer because the work happens on your own device.