Free Online Text Reverser, Backwards Text, Words and Lines
Reverse text four different ways: the whole thing backwards, each line backwards on its own, the word order flipped, or the letters inside every word flipped while the words stay put. Emoji, accents and joined characters are kept whole instead of being split in half.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
Why split('').reverse() Breaks Emoji
The one line everyone writes, and the three places it goes wrong.
A JavaScript string is a list of UTF-16 code units, not a list of characters. Everything
up to U+FFFF is one unit, so 'abc'.split('').reverse().join('') looks
correct and people stop testing there. A rocket is U+1F680, which does not fit in one
unit: it is stored as the pair D83D DE80. Reverse the units and you get DE80 D83D, which
is not a rocket and not anything else either. Browsers draw it as two replacement boxes.
The second break is combining marks. The word café can be stored as five
characters where the last one is a combining acute accent that sits on the letter before
it. Reverse that and the accent lands on the letter that now precedes it, so you get an
accent on the wrong letter. The third is the flag characters, which are pairs of regional
indicators: reversed, a flag becomes a different flag or no flag at all.
This page uses Intl.Segmenter with granularity grapheme where
the browser has it, which is the standard answer to "what counts as one character here".
Where it is missing, a fallback walks the string joining surrogate pairs, combining marks,
zero width joiners and regional indicator pairs into single units first. The counter
above shows both numbers, so you can see the difference on your own text.
How to Reverse Text
A few steps, and nothing is uploaded.
What to Know About Reversing Text
Including why a plain reverse breaks emoji, and what this cannot do.
Key Features & Capabilities
What this tool does, and what it deliberately does not.
About the Text Reverser
Reversing text sounds like a one line job, and for plain English it is. The reason this page exists is everything that is not plain English: emoji, accents, flags, and the characters that modern text is full of. A reverse that works by code units cuts those in half and produces squares, and the person who wanted a party trick ends up with broken text they then have to clean.
The four modes are here because "reverse" means four different things to the people who ask for it. Someone making a puzzle wants the whole thing backwards. Someone testing a form wants each line backwards. Someone writing a Yoda joke wants the word order flipped. Someone obfuscating a word in a screenshot wants the letters inside each word flipped while the sentence still reads at a glance. Giving them all one button each is simpler than explaining the difference.
The counter under the options shows the characters as a computer counts them and as a person counts them. On text with emoji those two numbers are different, and seeing them side by side is the fastest explanation of why a careless reverse breaks. It is also useful on its own when a form says it allows 280 characters and you want to know which 280 it means.
Frequently Asked Questions
Emoji, punctuation, right to left text and line endings.