Reverse Lines

Reverse the order of lines, or the letters in each line.

Result

fourth
third
second
first
4 lines · 25 bytes

What can be reversed?

There are three common meanings of "reverse" for text. You can flip the order of the lines, so the last line comes first. You can reverse the letters in each line, so "first" becomes "tsrif". Or you can reverse the words in each line, so "one two three" becomes "three two one".

This tool does all three. Letters are reversed as whole characters, so accented letters and emoji are not broken into pieces. Reversing a list of lines is useful for logs and histories, and reversing letters is a classic puzzle and test case for programmers.

How to use the Reverse Lines

  1. Paste your lines.
  2. Choose to reverse the order of lines, the letters in each line or the words.
  3. Copy the result.

Real situations

When people use the Reverse Lines

  • 1

    Put the newest entries first

    Reverse the order of a log or list that was written oldest first.

  • 2

    Flip a numbered list

    Turn a list that counts up into one that counts down, without retyping any line.

  • 3

    Check palindromes and word games

    Reverse the letters of a word to see whether it reads the same backwards.

  • 4

    Make test data

    Produce reversed strings quickly when you are testing an application, a script or your own code.

FAQ

Reverse Lines: questions answered

What happens to a four-line list?

With "The order of the lines", first, second, third, fourth becomes fourth, third, second, first. The lines themselves are unchanged.

What does reversing letters do?

Each line is reversed on its own, so "first" becomes "tsrif" and "second" becomes "dnoces". The lines stay in the same order.

How are words reversed?

Each line is split at spaces and the words are put back in the opposite order. "one two three" becomes "three two one". Punctuation stays attached to its word.

Does it break emoji or accents?

No. It reverses by character rather than by code unit, so an emoji or accented letter stays whole. A character built from several combined parts may still look different once reversed.

How do I sort instead of reverse?

Use the sort lines tool. Reversing flips the existing order, while sorting puts lines into alphabetical or numeric order.

Can I reverse a single line of text?

Yes. Paste it and choose the letters or words option. With one line, the order option does nothing because there is nothing to swap.

Is this Reverse Lines free and private?

Yes. It is free with no sign-in, and every calculation runs inside your browser. Nothing you type is sent to a server or stored, and the page keeps working offline once it has loaded.

Private by design. No accounts, no cookies, no tracking. Everything you type stays on your device.

How we keep it that way