Understanding the reverse text generator — concept and principle
This tool writes text backwards in four ways: all characters reversed, the word order on each line reversed, the letters inside each word reversed, or the line order reversed. It keeps emoji, flags and accented letters intact, and it checks whether your text is a palindrome when only letters and digits are compared.
How it is calculated
Text is split into user-perceived characters (grapheme clusters, Unicode Standard Annex #29).
- All characters: reverse the whole list of clusters
- Word order: reverse the words on each line, keeping the spaces between them
- Letters in each word: reverse the clusters within each word
- Line order: reverse the order of lines
Palindrome check: compare lowercased letters and digits forwards and backwards.
The principle
Reversing text sounds trivial, but a single visible character can be several code points: an e followed by a combining accent, a flag made of two regional indicators, or an emoji family joined by zero-width joiners. Reversing code points one by one would break these apart into broken symbols. Splitting into grapheme clusters first keeps each visible character whole. A palindrome reads the same in both directions, and ignoring spaces, punctuation and case reveals classic sentence palindromes.
Worked example
Default inputs: "Was it a car or a cat I saw?", reverse all characters.
- Characters as seen = 28; words = 9; lines = 1.
- Reversed text = ?was I tac a ro rac a ti saW.
- Letters only, lowercased: "wasitacaroracatisaw".
- Reading those backwards gives the same sequence, so the check reports Yes — reads the same backwards.
How to read the result
Use reversed text for puzzles, mirror-writing practice or checking palindromes. Word-order reversal is handy for language exercises; reversing letters in each word creates simple coded messages. Remember that reversed text is not encryption.
Common mistakes
- Expecting the palindrome check to consider spaces and punctuation; it ignores them.
- Confusing reversed text with mirror text, which also flips letter shapes.
- Using reversed text to hide information; it is trivial to undo.
Frequently asked questions
Why don't emoji break when reversed?
The text is split into grapheme clusters, so multi-code-point emoji stay whole.
What is a palindrome?
A word or phrase that reads the same forwards and backwards, like "racecar".
Does Korean text reverse correctly?
Yes, Hangul syllables are kept whole.
What is the difference between reversing words and letters?
Word reversal changes word order; letter reversal flips each word in place.
Sources: Unicode Standard Annex #29, "Unicode Text Segmentation" (grapheme cluster boundaries), as implemented by ECMAScript Intl.Segmenter (ECMA-402)