About the Reverse Text
Reverse text four different ways with a single menu: flip the whole string character by character, reverse the order of the words while leaving each word intact, reverse the order of the lines, or scramble the letters inside every word while keeping the words where they are. The reversal works on Unicode code points rather than raw bytes, so accented letters and most emoji survive the flip instead of turning into replacement squares. Your original text is left untouched beside the result, and nothing is sent anywhere.
How to use the Reverse Text
- 1
Type or paste your text into the 'Your text' box.
- 2
Pick a mode from 'Reverse by': Characters, Words, Lines, or Characters within each word.
- 3
The reversed version appears straight away in the Reversed panel.
- 4
Copy the result; your original input stays in the box so you can switch modes and compare.
What people use it for
Checking palindromes
Reversing by characters and comparing against the original is the direct test for a palindrome, once you have stripped spaces and punctuation with the Remove Extra Spaces tool.
Testing text handling in software
Reversed strings full of accents and emoji are a useful smoke test for whether an input field, a database column or a PDF exporter handles Unicode properly rather than assuming one byte per character.
Puzzles, ciphers and classroom activities
Reversing letters within each word keeps the sentence shape recognisable while making it unreadable at a glance, which works well for word games and simple substitution exercises.
Why reversing a string is harder than it looks
JavaScript stores strings as UTF-16, where a character may occupy one or two 16-bit units. Every character outside the Basic Multilingual Plane — which includes essentially all emoji, historic scripts and many mathematical symbols — is stored as a surrogate pair of two units. Reversing a string by naively splitting it on those units puts the low surrogate before the high one, producing an invalid sequence that browsers render as a replacement character. This tool avoids that by iterating the string with the spread operator, which walks code points rather than code units and keeps surrogate pairs together. That fixes the common case, though a layer of complexity remains. A user-perceived character, formally a grapheme cluster, can be several code points: an emoji with a skin tone modifier, a flag built from two regional indicators, a family emoji joined by zero-width joiners, or a letter followed by a combining accent. Reversing at code point level splits those clusters, so a decomposed e-acute comes back as an accent floating before a bare e. Text written in composed form, which is the norm for anything typed or copied from a modern source, reverses cleanly.
The difference between the four modes
Character mode reverses the entire input including its spaces and line breaks, so a two-line input comes back with the last line first and every line internally backwards. Word mode splits the text on whitespace while capturing the whitespace itself, reverses the resulting sequence and rejoins it, which means the words appear in the opposite order and the spacing pattern is mirrored along with them rather than being normalised. Line mode splits only on newlines and reverses that array, leaving every line's contents exactly as typed — this is the mode to use for flipping a log or a chronological list. The fourth mode reverses the letters inside each run of non-whitespace characters while leaving the runs in place, which preserves the sentence structure, all punctuation positions and the line breaks. Note that punctuation attached to a word travels with it in that mode, so 'world.' becomes '.dlrow', full stop and all.
Tips
- Use Lines mode rather than Characters mode when you want a log or list flipped without mangling the text.
- Reverse twice to get back to where you started — it is a lossless way to check the tool handled your Unicode correctly.
- For a palindrome test, clean the text of spaces and punctuation and lowercase it first, or the comparison will fail on formatting alone.