Skip to content

Reverse Lines

Flip a list upside down: the last line becomes the first, the second-to-last becomes the second, and so on.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Reverse Lines?

Reversing lines changes the order of a list without touching the content of any line. It is handy for chronological logs that need to be read newest-first, for stacks and undo histories, and for turning an ascending list into a descending one after a sort.

Unlike the Reverse Text tool, which mirrors the characters of a string, this tool only moves whole lines. Line endings (LF or CRLF) and the trailing newline of your input are preserved.

How does it work?

  1. Paste your list with one item per line.
  2. Optionally tick "drop empty lines" to ignore blank lines while reversing.
  3. Copy the reversed list from the result box.

Common use cases

  • Reading an oldest-first log file with the newest events at the top.
  • Reversing a sorted list to get a descending order without re-sorting.
  • Flipping a numbered to-do list or a queue.
  • Reordering CSV rows pasted as text (without touching the columns).

Examples

Try this input in the tool above:

Input
first
second
third
fourth
fifth
Output
fifth
fourth
third
second
first

Privacy

Reverse Lines runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Only the order of lines changes; the characters inside each line stay as they are. To mirror characters, use the Reverse Text tool.

Frequently asked questions

Does it reverse the letters inside each line?

No. Each line keeps its text; only the sequence of lines is reversed. Use Reverse Text with the "each line" mode to mirror the characters.

What happens with empty lines?

They are reversed like any other line unless you tick "drop empty lines", in which case they are removed first.

More tools in Text Tools →