Reverse Lines
Flip the order of lines in a list, a log file or any multi-line block. The first line becomes the last and the text inside each line is left completely untouched.
This is the only reversal on the site that treats your text as records rather than characters, which makes it the right tool for chronological data — turning an oldest-first log into a newest-first one without a script.
Want the words reversed too? Reverse word order
Line Order Examples
Line reversal never touches the characters inside a line. These rows show what that means in practice, including the CRLF case.
| Input | Output | What it shows |
|---|---|---|
| Line 1 Line 2 Line 3 | Line 3 Line 2 Line 1 | The basic case: three lines, order flipped, contents identical. |
| apple banana cherry | cherry banana apple | An alphabetical list becomes reverse alphabetical without sorting. |
| only line | only line | Single-line input is returned unchanged. |
| a b | b a | A blank line keeps its position relative to the lines around it. |
| 2026-01-01 start 2026-06-01 middle 2026-07-01 end | 2026-07-01 end 2026-06-01 middle 2026-01-01 start | Oldest-first log becomes newest-first. |
| 1. first 2. second 3. third | 3. third 2. second 1. first | Numbering does not renumber — the list reverses with its original labels. |
| a b | b a | CRLF is matched as one ending, so Windows line breaks stay where they were. |
| top middle bottom | bottom middle top | A trailing newline creates an empty final line, which becomes the first line. |
How Line Reversal Works
Three lines of code, but the behaviour around line endings and blank lines is worth spelling out.
The text splits on any line ending
CRLF, a lone carriage return and a bare line feed are all recognised as one break. Every line becomes an array element, the array is reversed, and the original separators are put back where they were. Nothing inside a line is examined or modified.
Blank lines are lines
An empty string between two newlines is an array element like any other, so blank lines keep their relative position in the reversed output. Paragraph spacing therefore survives the reversal.
Windows line endings survive
CRLF is two characters, and a reverser that splits on \n alone strands the \r at the end of a different line. This one matches CRLF as a single ending and leaves the separators in place while the line contents move, so text pasted from a Windows editor comes back with its endings unchanged.
It reverses back exactly
Running the output through the tool again reproduces your original, because no content is changed and no line is added or removed.
Lines, Words or Characters
Applied to the same three-line block, the four reversals produce very different results.
Shared input: alpha one beta two gamma three
| Transformation | Result | Reach for it when |
|---|---|---|
| Reverse lines | gamma three beta two alpha one | You want the record order flipped, contents untouched. |
| Reverse words | three gamma two beta one alpha | You want every word reordered across the whole block. |
| Reverse each word | ahpla eno ateb owt ammag eerht | You want each word spelled backwards, layout kept. |
| Reverse everything | eerht ammag owt ateb eno ahpla | You want one continuous end-to-start reversal. |
Line Reversal Edge Cases
These four cases account for nearly every surprise when reversing files rather than prose.
A trailing newline becomes a leading blank line
Text files conventionally end with a newline, which creates an empty final element. After reversal that empty line is first, so the output appears to start with a blank line. Delete the trailing newline first if that matters.
Numbered lists do not renumber
The tool moves lines, it does not interpret them. A list numbered 1, 2, 3 comes back as 3, 2, 1 with the original numbers attached — usually not what you want for a numbered list.
Wrapped text is not lines
A paragraph that wraps visually is one line as far as the tool is concerned. Only actual newline characters create lines, so soft-wrapped prose reverses as a single unit.
CSV headers move too
Reversing a CSV puts the header row at the bottom. Cut the header out first, reverse the body, then put the header back.
Working with Lists and Logs
Line reversal is the most "practical" tool on the site — most of its use is data handling rather than novelty.
Log files
Turning an oldest-first log into newest-first is the most common use. Paste the block, reverse, and read the most recent events at the top without piping through tac or Sort-Object.
Spreadsheet columns
Copy a column, reverse it here, paste it back to flip the row order without adding a helper column and a sort. Blank cells become blank lines and keep their positions.
Markdown and documents
Reversing a bulleted list works cleanly because bullet characters travel with their line. Numbered lists need renumbering afterwards.
Code and config files
Useful for reordering import blocks or environment files. Because contents are untouched, indentation is preserved exactly as it was.
Reasons to Reverse Line Order
Newest-first reading
Chronological exports almost always come oldest-first. One paste turns them into the order you actually want to read.
Reversing a ranked list
Turn a top-ten list into a countdown, or vice versa, without retyping or re-sorting.
Building test data
Reversed fixtures catch code that quietly assumes input arrives in a particular order.
Quick diffs by eye
Reversing both of two lists puts their tails side by side at the top, which sometimes makes a difference easier to spot.
Frequently Asked Questions
Paste your multi-line text into the box above. The lines appear in the opposite order immediately, with the contents of each line unchanged.
No. Only the order of the lines changes. Every character within a line, including indentation, is left exactly as it was.
Blank lines are treated as lines and keep their relative position, so paragraph spacing survives the reversal.
Your input ended with a newline, which creates an empty final line. After reversal that empty line comes first. Remove the trailing newline before pasting if you do not want it.
Yes. CRLF is treated as a single line ending and the separators stay in their original positions, so the output remains valid CRLF text with no stray carriage returns. Classic Mac CR-only files work the same way.
Yes, but the header row will end up at the bottom. Remove the header first, reverse the body, then put the header back on top.
No. The tool moves whole lines without interpreting them, so a list numbered 1, 2, 3 comes back as 3, 2, 1 with the original numbers attached.
There is no fixed limit, and everything happens in your browser so nothing is uploaded. Very large pastes may take longer or use substantial memory, depending on your device and browser.
Related Text Tools
Text Reverser
Compare six backwards-text results side by side from one input.
Backwards Text Generator
Turn any sentence into backwards text, character by character.
Text Inverter
Invert text three ways — backwards, upside down or mirrored — and compare.
Write Backwards Tool
Type forwards and read backwards, plus how to write in reverse by hand.
Sentence Reverser
Reverse a whole sentence or message, by word order or letter by letter.
Letter Reverser
Reverse the letters inside every word while the words stay in place.
Backwards Text Translator
Translate text to backwards and decode backwards text in one pass.
Character Reverser
Code-point-accurate character reversal that keeps emoji intact.