Text Reverser

How to use 3 steps
  1. Paste your Text.
  2. Choose how to reverse it and press Reverse.
  3. Press Copy.
Reversed text

Character reversal is done on Unicode code points rather than UTF-16 units, so emoji and accented letters survive intact instead of breaking apart.

How this tool works

Four different operations share one box, because reversing means four different things depending on what you are doing. Reversing characters walks the text backwards a code point at a time. Reversing words flips the order of words within each line while leaving the whitespace between them intact. Reversing lines flips the order of the lines and leaves each line as it was. Reversing within words keeps every word where it is and turns each one back to front.

Splitting is done by code point rather than by the units a string is stored in, which keeps characters outside the basic range — most emoji, many CJK extensions, mathematical symbols — from being torn in half and turned into replacement squares. That is as far as it goes: the operation is defined on code points, not on what a reader would call a character.

Where reversal stops behaving intuitively

  • Accents that are stored separately move: a letter written as a base plus a combining accent is two code points, and reversing them lands the accent on whichever letter now precedes it. Text using precomposed characters is unaffected.
  • Composed emoji come apart: flags, skin tones and family sequences are several code points joined together. Reversed, they separate into their pieces rather than surviving as one symbol.
  • Reversing words works line by line: each line is flipped on its own and the lines stay in their original order. Use line mode when you want the whole document turned around.
  • Reversed text is not right-to-left text: the characters are in the opposite order, which is a different thing from a language that is read that way. Arabic and Hebrew are not converted by reversing them.

Code points, not characters as people see them

Reversing text sounds trivial and is not, because what counts as "a character" depends on who is asking.

The [msm_tool slug="reverse-text"] reverses by code point. For plain English that is exactly right and the result is what you expect. For anything else it can come apart, and the reason is worth understanding.

What comes apart

  • Composed emoji. A family emoji or a flag is several code points joined by invisible connectors. Reversed, the connectors end up in the wrong places and the emoji separates into its components — a family becomes individual people, a flag becomes two letters.
  • Skin tone modifiers. These follow the emoji they modify. Reversed, the modifier lands before it and applies to whatever now precedes it, or to nothing.
  • Combining accents. An é can be one code point or two — an e followed by a combining acute. In the two-code-point form, reversing puts the accent on the wrong letter.
  • Scripts with joining behaviour, such as Arabic and Urdu, where letters change shape depending on their neighbours. Reversed, the shaping is wrong throughout.

None of this is a bug in the reversal. It is what reversing a sequence of code points does, and no simple implementation avoids it.

Right-to-left text is a different problem

Arabic, Hebrew, Urdu and Persian are already displayed right to left by the browser. Reversing their code points does not produce mirrored text — it produces text in the wrong logical order, which then gets displayed right to left as well, and the result is nonsense in both directions.

If you want to display text in the other direction, that is a CSS matter rather than a text-transformation one. Reversing the characters is not how it is done.

Word reversal is a different operation

Reversing the order of words — "one two three" becoming "three two one" — keeps each word readable. Reversing characters gives "eerht owt eno".

Both are called reversing and they are not the same thing. Decide which you want before running either.

What it is actually for

Honestly, not much in production. The genuine uses are narrow:

  1. Testing that a system handles unusual input. Reversed text is a quick source of strings that look wrong and are valid.
  2. Puzzles, wordplay and palindrome checking. Reversing and comparing is the whole algorithm.
  3. Demonstrating the code point problem to someone who does not believe text is complicated.
  4. Novelty — a reversed name, a hidden message, a bit of decoration.

What it is not for

Obfuscation. Reversed text is readable by anyone who notices, and trivially reversed by anything automated. It hides nothing from a scraper, a filter or a curious reader, and treating it as concealment is a mistake people make with email addresses.

It is also not encoding. There is no key and no transformation beyond the order.

Nothing is uploaded

The reversal happens in your browser. Worth knowing given that the main legitimate use is testing with input you might not want to paste elsewhere.

Frequently Asked Questions

Specific to the Text Reverser. Broader questions about this category are answered on the category page.

Single-code-point emoji survive. Anything built by joining several together — flags, families, skin tones — separates into its parts.
Word mode changes the order of the words. Within-word mode leaves the order alone and reverses the letters inside each word.
Each line separately, with the lines left in their original order. Line mode is what reverses the document as a whole.
Those letters were stored as a base letter plus a separate accent mark. Reversing the sequence moves the mark onto its new neighbour.
No. It only changes the order of characters. Languages read from right to left need the actual script, not Latin letters in reverse.

Subscribe to receive notifications about new tools, features, and productivity tips.