Reverse Text
Reverse text by characters, words or lines, working on grapheme clusters, so emoji, skin tones, flags and accented letters move as whole units instead of coming apart. The obvious one-line implementation does not do this, and the tool shows you the difference.
Reversed
Reversed text appears here.
Nothing to reverse yet.
Grapheme clusters, not code unitsEmoji and accents stay wholeNothing leaves your browserNo size limit
Last character first: emoji, accents and flags stay whole.
Reversing a string is a trick question. JavaScript's obvious answer splits family emoji into their component people, detaches accents from their letters, and re-pairs flag letters into flags of countries that were never in your text. What has to be reversed is the grapheme cluster, the unit a reader calls a character. This walks those, and prints the naive result beside it whenever the two differ.
Accuracy. Exact, inside limits it names. Every mode works on Unicode grapheme clusters (UAX#29), so emoji, skin tones, flag sequences, keycaps and combining accents move as whole characters: not one code point is lost, invented, or torn in half. Reversing twice returns your text unchanged except in the cases below, and the tool checks YOUR text for each of them and says so on screen when one applies. Right-to-left text is reversed in logical order, which is the only well-defined answer but will not look reversed on screen. A stray flag letter left over from an odd number of them pairs with a different neighbour after reversing, so the flags shown change even though no character is lost, and loose Hangul jamo compose the same way. A combining mark, joiner or prepending character that had nothing to attach to lands beside a character it can attach to, and an unpaired half of a character can land next to its opposite half. In the three line modes, a text that mixes CRLF, LF and CR endings is rewritten to the first ending it used, and a blank first line in a text that does not end with a line break can only come back as a line break at the end. And flip is a best-effort substitution: only characters that have an upside-down look-alike in Unicode are swapped, the rest pass through unchanged.
Common questions
- Why is reversing a string harder than it looks?
- Because the obvious approach splits by code unit, and many things people think of as one character are several. A family emoji is a sequence of people joined by zero-width joiners; a flag is two regional indicators; é may be an e plus a combining accent. Reverse by code unit and the family comes apart into individuals, the flag becomes a different flag, and the accent lands on the wrong letter. This walks grapheme clusters instead, and shows the naive result alongside so the difference is visible.
- What are the different reverse modes?
- Characters reverses the whole string. Words reverses the letters within each word but keeps the words in place. Word order keeps each word intact but reverses their sequence. Lines reverses the order of lines, leaving each line as it is. Flip is separate: it substitutes upside-down look-alike characters rather than reversing anything.
- Does reversed text still read correctly in right-to-left languages?
- Not necessarily, and this is worth knowing before relying on it. Arabic and Hebrew are stored in logical order and displayed right-to-left by the renderer, so reversing the stored characters produces something that displays in an order most readers would not expect. The tool reverses what is there and flags when the input contains right-to-left text.
- Why does the upside-down mode leave some characters alone?
- Because Unicode has no inverted form for them. There is a turned a, e and m, but no turned equivalent for many symbols and most non-Latin scripts. Substituting something that merely looks similar would quietly change the text, so anything without a genuine inverted counterpart passes through as-is.
- Is it safe to paste a large document?
- Yes. Everything runs in your browser with no size limit imposed, and nothing is uploaded. A megabyte of text reverses well inside a second.
- Do Windows and Unix line endings give the same result?
- Yes. Line endings are normalised before reversing, so the same text produces the same output whether it came from Windows, macOS or Linux. Without that, a CRLF file reverses into text with the carriage return on the wrong side of each line break.
Exact for reversal. Every mode works on Unicode grapheme clusters, so emoji sequences, keycaps, flags and combining accents stay intact. The upside-down flip mode is explicitly approximate: it substitutes only characters that have an inverted Unicode look-alike and passes the rest through unchanged.