Reverse Text, Words and Lines
Pick what to reverse: the characters, the order of the words, the order of the lines, or each word on the spot. The reversal counts by what you see rather than by what the browser stores, so accents stay on their letters and emoji survive in one piece.
Why reversing a string is harder than one line of code
The version everyone writes first is s.split('').reverse().join(''). It works on plain English and quietly destroys everything else, because JavaScript stores text as UTF-16 code units rather than as characters a reader would recognise. There are three separate ways it goes wrong.
- Surrogate pairs. Every character above U+FFFF — most emoji, some rarer CJK, every historic script — is stored as two code units. Reversing swaps them into an invalid order, and the browser renders two replacement squares.
- Combining marks. An accented letter can be stored as a base letter followed by a combining mark: "e" plus U+0301 displays as é. Reverse the sequence and the accent lands before its letter, where it attaches to whatever is now in front of it. The accent moves to the wrong word.
- Joined sequences. A single emoji is often several: the developer emoji is a person, a zero-width joiner and a laptop. Reversed, the pieces come out in an order with no defined rendering and you get two unrelated emoji instead of one. Flags are worse — they are two regional indicator letters, so a reversed flag can turn into a different country or into nothing at all.
Spreading the string with Array.from fixes the first problem and neither of the others. What fixes all three is Intl.Segmenter with grapheme granularity, which groups code points into what a reader counts as one character. This tool uses it, and falls back to code points in browsers too old to have it — the note under the buttons tells you when that happens.
Four things "reverse" can mean
Reversing characters across the whole text also turns the line order and the word order inside out, which is usually not what people want. The modes above separate them:
- Reverse characters — the literal mirror of the whole text, last character first.
- Reverse word order — words come out back to front, each word still spelled correctly. This is the one you want for testing a sort, or for a word-order puzzle.
- Reverse line order — the last line becomes the first. Useful for log files that print newest last, or for flipping a chronological list.
- Reverse each word — every word spelled backwards in place, sentence structure intact.
Right-to-left text does not need reversing
Arabic, Hebrew, Persian and Urdu are stored in logical order — the order you say them — and the browser handles the right-to-left display on its own. Reversing the string gives you text that is logically backwards and still rendered right-to-left, which is wrong twice. If you are testing an interface for RTL layout, set the dir attribute to rtl and use real translated text. Reversed Latin is not a substitute.
Upside-down text is a costume
The flip mode does not rotate anything. It swaps each letter for a different Unicode character that happens to look like the letter turned over: ɐ is a Latin turned a from the phonetic alphabet, ᄅ is a Hangul consonant standing in for 2, ㄣ is a bopomofo letter standing in for 4. The text then gets reversed so it reads correctly if you rotate your screen.
That has consequences worth knowing before you paste it into a profile. A screen reader announces the real characters, so your bio is read as a stream of phonetic and Korean letters. Search will not match it. Fonts that lack these glyphs show empty boxes, which is common on older Android and on some e-readers. Some platforms strip or normalise the characters on save. And uppercase letters have no turned forms in this map, so they come out in lowercase shapes.
What reversing is not good for
It is not obfuscation. Reversed text is readable by anyone who thinks about it for a second and undone by one line of code, so it is fine for hiding a spoiler from a casual glance and useless for anything you actually need kept private.
It is also not mirroring. Reversing characters leaves brackets and quotation marks facing the way they were, so (hi) becomes )ih( — correct as a reversal, broken as a mirror image. Only the upside-down mode swaps the paired characters, because there the whole point is that the result should read as text.
Finally, it has no idea what your text means. Markup, indentation, CSV columns and code all come out structurally destroyed. Reverse the words in a sentence, not in a config file.
Frequently asked questions
Does reversing break emoji?
Not here. The tool splits text into graphemes — the units a reader sees as one character — so multi-part emoji, flags and skin tone modifiers stay intact. The naive approach of splitting a string into its code units does break them, which is why reversed emoji often appear as empty squares elsewhere.
How do I reverse the order of words but keep the spelling?
Use the "Reverse word order" mode. It flips the sequence of words on each line and leaves every word spelled the way you typed it. "Reverse each word" does the opposite: word order intact, letters backwards.
Can I reverse the lines of a list?
Yes, that is the "Reverse line order" mode. The last line becomes the first and each line is left untouched. Blank lines are kept, so the spacing of a list survives.
Is upside-down text safe to use in a username or bio?
It works visually on most modern devices, but it is made of substituted characters, not styling. Screen readers announce those characters literally, search engines will not match your name, and platforms that normalise input may reject or mangle it.
Is reversed text a way to hide something?
No. It is readable with a little effort and undone instantly by any tool, including this one. Use it for spoilers and puzzles, never for anything that needs to stay private.
Last updated September 19, 2026