How this tool works
Four different operations share one box, because reversing means four different things depending on what you are doing. Reversing characters walks the text backwards a code point at a time. Reversing words flips the order of words within each line while leaving the whitespace between them intact. Reversing lines flips the order of the lines and leaves each line as it was. Reversing within words keeps every word where it is and turns each one back to front.
Splitting is done by code point rather than by the units a string is stored in, which keeps characters outside the basic range — most emoji, many CJK extensions, mathematical symbols — from being torn in half and turned into replacement squares. That is as far as it goes: the operation is defined on code points, not on what a reader would call a character.
Where reversal stops behaving intuitively
- Accents that are stored separately move: a letter written as a base plus a combining accent is two code points, and reversing them lands the accent on whichever letter now precedes it. Text using precomposed characters is unaffected.
- Composed emoji come apart: flags, skin tones and family sequences are several code points joined together. Reversed, they separate into their pieces rather than surviving as one symbol.
- Reversing words works line by line: each line is flipped on its own and the lines stay in their original order. Use line mode when you want the whole document turned around.
- Reversed text is not right-to-left text: the characters are in the opposite order, which is a different thing from a language that is read that way. Arabic and Hebrew are not converted by reversing them.