Text Reverser, Reverse Text, Words, or Lines Free
This text reverser flips your text four different ways: reverse every character, reverse word order, reverse line order, or reverse the letters inside each word while keeping word order intact. Paste, choose a mode, and copy the result instantly, no sign up needed.
How this text reverser handles four reversal modes without breaking emoji
Reversing a string looks like a solved problem until you try it on real text with emoji, accented letters, or multi word sentences you want mirrored word by word rather than letter by letter. This tool separates those concerns into four explicit modes, and its core reversal function is written specifically to avoid the most common bug in naive string reversal code: breaking apart characters that are stored as pairs in memory.
All four modes run instantly in your browser against whatever you type. Nothing is sent to a server.
The surrogate pair problem, and how this tool avoids it
JavaScript strings are encoded in UTF-16. Most characters fit in one 16 bit code unit, but characters outside the Basic Multilingual Plane, which includes most emoji, are stored as a surrogate pair: two 16 bit code units that only mean something when read together. The classic reversal bug is s.split('').reverse().join(''), which splits on code units, not characters. Run that on a string containing an emoji and the two halves of its surrogate pair get separated and reversed independently, corrupting the emoji into mangled replacement characters.
Array.from() iterates a string using its iterator protocol, which is defined in terms of Unicode code points, not raw UTF-16 code units. That means a surrogate pair is treated as one unit and reversed as one unit, correctly keeping the emoji intact. This is a real, meaningful difference from the naive split('') approach, and it is the reason this tool can reverse a sentence containing emoji without turning them into broken glyphs.
Array.from correctly avoids splitting surrogate pairs, but it will still split a joined sequence into its separate code point pieces, since each piece is a valid code point on its own. Full grapheme cluster awareness needs the Unicode text segmentation rules, which is a separate and more involved fix than this tool implements.The four modes
replace(/[^\s]+/g, word => revStr(word)) to reverse the letters inside every word while leaving word order and spacing untouched. This is the mode people usually mean when they say scramble each word.
A worked reversal
| Mode | “Hello world 🎉” becomes |
|---|---|
| Characters | 🎉 dlrow olleH |
| Words | 🎉 world Hello |
| Each word | olleH dlrow 🎉 |
Palindrome detection, built in
How it checks
The input is lowercased and stripped of anything that is not a letter or digit with replace(/[^a-z0-9]/g, ''), then compared against its own character reversal. Spaces and punctuation are ignored, so “A man, a plan, a canal, Panama” correctly registers as a palindrome.
When it stays silent
Inputs shorter than two cleaned characters return no verdict at all rather than a false positive, since a single character or empty string being a palindrome is not a meaningful result worth displaying.
- MDN on Unicode in JavaScript strings explains UTF-16 and surrogate pairs in detail.
- MDN on Array.from covers its code point aware string iteration behavior.
- Unicode Text Segmentation, UAX #29 for the grapheme cluster rules a full emoji safe reverser would need.
- Palindrome for the general definition this tool’s check implements.
Where reversal is actually useful
Building a mirrored watermark for a document, generating a word puzzle where letters need scrambling within each word, checking a phrase for a palindrome before using it as a party trivia question, reversing lines in a log file that were appended oldest last, and testing whether a piece of UI text still displays correctly when its character order is flipped for right to left layout debugging.
FAQ: Text Reverser
Reversing characters flips the entire string into a mirror image, “Hello world” becomes “dlrow olleH,” which usually isn’t readable. Reversing word order keeps each word spelled correctly but swaps their positions, so “Hello world” becomes “world Hello,” which reads as normal words in a new order.
When checked, character reversal happens independently within each line, so line five stays line five, just spelled backward. When unchecked, the entire block of text is reversed as one continuous string, which also flips the overall line order since line breaks get reversed along with everything else.
Not automatically, but you can check manually, reverse your text using Reverse Characters, then compare the result to your original input. If they match exactly, ignoring spaces and punctuation if you’d like a looser check, your text is a palindrome.
Yes, this tool reverses text using Unicode aware character splitting rather than raw string indexing, which prevents emoji, accented letters, and other multi byte characters from breaking apart or appearing garbled in the reversed output.
It spells every word backward while keeping sentence structure and word order intact, useful for puzzles, word games, testing text parsing logic, or creating stylized captions where individual words appear scrambled but the sentence flow stays recognizable.
Yes, there’s no character limit, paste as much text as you need and it processes instantly since everything runs locally in your browser rather than being uploaded to a server.
Reverse Line Order flips the position of lines but doesn’t renumber them, so if your list has manual numbers typed into each line, those numbers will stay attached to their original line and end up out of sequence. Remove manual numbering first if you want a clean reordered list.
No, all reversing happens locally in your browser using JavaScript, nothing you type or paste is sent to a server, logged, or stored anywhere.
From the blog
Writing about writing tools
Readability scoring, keyword density and the rest, examined properly.