Three different meanings of reversing text
Reversing text is ambiguous until you say what the unit is. Reversing by character turns Hello world into dlrow olleH, with the letters of every word scrambled. Reversing by word keeps each word intact and flips their order, giving world Hello. Reversing by line leaves every line untouched and flips the order of the lines, which is the operation you want for a log file or a chronological list.
This tool offers all three as separate modes because they serve different purposes. Character reversal is for puzzles, for palindrome checking and for producing mirrored text. Word reversal is used in language exercises and in reordering short lists. Line reversal is the everyday one: turning oldest-first into newest-first, or flipping a sorted list without re-sorting it.
Word mode operates line by line, so multi-line input keeps each line's words within that line rather than reversing the whole document into one run. It also preserves the whitespace between words by splitting on whitespace and keeping the separators in place, so runs of multiple spaces survive the round trip instead of collapsing to one.
Why naive character reversal breaks Unicode
The obvious implementation, splitting a JavaScript string on the empty string and reversing the array, is broken for anything outside the basic multilingual plane. JavaScript strings are sequences of UTF-16 code units, and a character above U+FFFF is stored as a surrogate pair of two units. Reversing the units puts the low surrogate before the high one, which is not a valid sequence, and the output renders as replacement characters.
That affects most emoji, mathematical alphanumerics, many historic scripts and a large part of the extended CJK range. This tool avoids it by iterating with Array.from, which uses the string iterator and therefore walks code points rather than code units, keeping each surrogate pair together as a single element.
Code points are a significant improvement over code units and are still not the same as what a reader perceives as a character. A grapheme cluster can be several code points: a base letter followed by combining accents, a Hangul syllable written in decomposed jamo, a regional indicator pair forming a flag, or an emoji joined by zero width joiners into a single glyph. Reversing at the code point level takes those sequences apart, so an accent can migrate onto the wrong letter and a composite emoji can split into its components.
Right-to-left text is a separate problem
Arabic, Hebrew, Persian and Urdu are stored in memory in logical order, the order in which they are read, and the display engine reverses them visually at render time according to the Unicode bidirectional algorithm. That means text that appears right to left on screen is not stored backwards, and reversing the stored order does not produce a visually reversed result.
Applying character reversal to Arabic also separates letters from their contextual forms and from the zero width joiners and non-joiners that control cursive shaping, so the output is usually unreadable rather than mirrored. The same applies to Indic scripts, where a vowel sign that renders to the left of a consonant is stored after it.
If what you want is visually mirrored text rather than a reversed string, the tool for that is CSS, not a string operation. transform: scaleX(-1) mirrors an element's rendering while leaving its content and its accessibility tree intact, and the direction property handles genuine right-to-left layout.
Practical uses for each mode
Line reversal is the mode with the most everyday utility. Log files, chat exports and changelogs often arrive oldest-first when you want to read newest-first, and reversing is faster and safer than re-sorting when the lines have no parseable timestamp. It also pairs well with a deduplication step when you want to keep the last occurrence of a repeated line rather than the first.
Character reversal is the basis of palindrome checking: normalise the text by lowercasing and removing punctuation, reverse it, and compare. It also appears in interview exercises, word games and simple ciphers, though like ROT13 a reversed string offers no security whatsoever and should never be used to conceal anything.
Word reversal is narrower. It shows up in language teaching, in testing how a parser handles unexpected ordering, and in generating text for layout tests where you want realistic word shapes in an unfamiliar order. All three modes run locally in the page, so nothing you paste is transmitted.