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/ Your data stays in your browser.
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?
- Paste your list with one item per line.
- Optionally tick "drop empty lines" to ignore blank lines while reversing.
- 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:
first second third fourth fifth
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.
Related tools
Sort Lines
Order any list one item per line: A to Z, Z to A, natural, numeric or by length.
Text Tools
Shuffle Lines
Randomize the order of any list with one click, using a fair shuffle that every arrangement is equally likely to result from.
Text Tools
Reverse Text
Write text backwards, reverse the order of its words, or flip it upside down, without breaking emoji or accents.
Text Tools
Remove Duplicate Lines
Paste a list and keep only unique lines, in the original order or sorted, with a count of what was removed.
Text Tools
Remove Empty Lines
Strip blank lines from pasted text in one click, or keep a single blank line between paragraphs.
Text Tools
Trim Lines
Remove the spaces and tabs at the start and end of each line of a list or block of text.
Text Tools