twoodo
/

Home/Tools/Text & developer utilities

Reverse Text

Three kinds of reversal, and emoji survive all of them.

Three different operations

  • Line order — the last line becomes the first. Useful for log files written oldest-first when you want newest-first.
  • Word order — each line's words are reversed, the lines stay put.
  • Every character — the whole text backwards.

Reversing characters is harder than it looks

The naive approach splits a string into its code units and reverses them. That breaks anything outside the basic character set: emoji, many Asian characters and mathematical symbols are stored as pairs, and reversing the pair produces an invalid character.

This iterates by actual character rather than by code unit, so emoji survive intact. If another tool has turned your text into replacement boxes, this is why.

Combining marks are still a limitation nobody solves perfectly: an accent stored separately from its letter will end up attached to the wrong one. Precomposed characters, which is how most text is stored, are fine.

Palindromes

Reverse a palindrome and you get the same text back. Testing one properly means stripping punctuation, spaces and case first — "A man, a plan, a canal: Panama" only works once you do.

Common uses

  • Flipping a log file to put recent entries first.
  • Reversing a list without sorting it.
  • Checking a palindrome.
  • Puzzles and word games.

Questions people ask

Why do other tools break my emoji?

Because they reverse code units rather than characters. Emoji are stored as pairs, and reversing the pair produces an invalid character.

What is the difference between the three options?

Line order flips which line comes first, word order flips the words within each line, and character reversal flips the entire text.

Does it handle accented characters?

Precomposed ones, yes. An accent stored as a separate combining mark will attach to the wrong letter, which no simple reversal solves.

Your text stays in the page

This matters more here than on most tools. People paste API keys into hash generators, customer data into CSV converters, contract wording into diff checkers and configuration into JSON validators. Almost every site offering these sends your input to a server to process it.

Nothing here is transmitted. The work happens in your browser, this site is static files with no server behind it, and the about page lists every request the site makes, read live from your own browser so you can check rather than trust.