Text reverser
Reverse a string by characters ("Hello" → "olleH"), reverse word order, or reverse the order of lines. Three modes, one input.
What this tool does
Three small text operations bundled into one tool:
- Reverse characters flips a string end-to-end. "Hello" becomes "olleH". Useful for puzzles, ciphers, and the occasional design need.
- Reverse words keeps each word intact but reverses their order. "the quick brown fox" becomes "fox brown quick the". Handy when adapting copy for languages that read right-to-left, or when sorting a list of last-first names.
- Reverse lines flips the order of lines in a multi-line input. The first line becomes the last and vice versa. Common when you've sorted a list and need the opposite order without re-sorting.
Unicode-safe character reversal
The character-reversal mode uses Array.from() to split the string by Unicode code points rather than UTF-16 code units. That means combined characters, emoji, and non-Latin scripts reverse correctly. A naive string.split('').reverse().join('') would corrupt emoji and accented characters; this tool doesn't.
One subtlety: a grapheme cluster like a flag emoji (🇺🇸) is made of two regional-indicator code points, and reversing them produces a different flag. Truly grapheme-aware reversal requires the not-yet-everywhere Intl.Segmenter API; for cleaner output, avoid pasting flag emoji into the character-reversal mode.
When to use it
Honestly, not often — but when you need it, having a clean tool beats writing one-line JavaScript in the console. Use cases include:
- Testing whether your code handles RTL or palindrome inputs.
- Generating reversed strings for a "reverse this word" puzzle or quiz.
- Quick sanity-check of file output order — paste, reverse lines, look at the new top.
- Adapting CSV column-order or list ordering for an import.
Examples
| Input | Mode | Output |
|---|---|---|
Hello, World! | Characters | !dlroW ,olleH |
the quick brown fox | Words | fox brown quick the |
a | Lines | c |
Privacy
Everything happens in your browser.