stoolme
Home/ Writing/ Text reverser

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

InputModeOutput
Hello, World!Characters!dlroW ,olleH
the quick brown foxWordsfox brown quick the
a
b
c
Linesc
b
a

Privacy

Everything happens in your browser.

Frequently asked questions

Does this work with emoji?
For character reversal, most emoji reverse correctly because we split by code point. Compound emoji like flags or skin-tone-modified faces may not survive a reversal cleanly — that's a limitation of how Unicode encodes them, not the tool.
What about right-to-left languages?
Reversing Arabic or Hebrew text by characters produces visually correct but semantically incorrect output. The display direction is handled by your browser, but the underlying character order is what gets reversed.
Why would I reverse lines?
A common use is reversing the order of a sorted list — e.g. you have an alphabetical list of items and you want them in reverse-alphabetical order without resorting from scratch.
Is there a maximum length?
Practically no. Modern browsers happily reverse strings of tens of megabytes.