Text desk

Reverse Lines

Reverse the order of lines while keeping each line unchanged.

Reverse Lines: Turn a list upside down so its last entry comes first. Reverse Lines moves complete lines, including blank entries, while leaving the letters, spaces and punctuation inside each entry intact. Use it to change the reading order of a pasted checklist or a simple log extract. Runs 100% locally in your browser with zero server file uploads.

Category
Text tools
Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
Reverse Lines / local editorLocal processing

Runs entirely in your browser

100,000 character input · 10,000 logical lines · 200,000 character output

Result

Ready

Text is processed locally. The tool uses literal, allowlisted operations and does not execute regular expressions or code.

Position rule and worked example

Let n be the number of logical lines and i a position counted from 1. The output at position i is the input at position n + 1 − i. For input 10\r\n20\r\n30\r\n, n = 3: output positions 1, 2 and 3 take input positions 3, 2 and 1. The exact result is 30\n20\n10\n. Here the escape notation shows invisible line endings; paste the numbers on actual separate lines to reproduce it.

Reversal, collation and size

Language-sensitive comparison is a different task. The Unicode Collation Algorithm (https://www.unicode.org/reports/tr10/) explains ordering conventions; this operation makes no collation decisions and does not split emoji or reorder combining marks inside a line. Input is limited to 100,000 Unicode code points and 10,000 logical lines; output has a 200,000-code-point ceiling. The editor also counts UTF-16 units, so some emoji use two places in its input allowance. Split longer logs into batches, then reverse the batch order as well as each batch to obtain a full-file reversal.

How to use it

  1. Paste or type your lines in the local editor.
  2. Set the options shown for this transformation and run it.
  3. Review the result, then copy or download the text.

Privacy & limitations

Your text and result stay on this device. There is no upload or execution of entered code.

Related tools

Frequently asked questions

Does reversing a list put it into alphabetical order?

No. Reversal follows the original positions, so pear, apple, banana becomes banana, apple, pear. It never compares words, accents or numbers. Alphabetical ordering needs a separate sort with an explicit language or collation rule; reversing an unsorted list cannot supply that rule.

What happens to an empty entry in the middle?

It moves like any other entry. Three lines containing first, a blank, and last become last, a blank, and first. An entirely empty input produces empty output. Two consecutive line breaks represent a blank entry, whereas the final line break alone is formatting.

Will reversing preserve Windows line endings?

The output uses LF separators after recognising both Windows CRLF and standalone CR. A final line ending remains at the end when there are lines to render. Keep the original file if its exact byte layout matters, because reversal also normalises those separators.

Free tool · runs in your browser · no account required