๐Ÿ”ƒ Text Reverser

Reverse a piece of text by character, word, or line. Fun for making novelty strings, or useful for reversing the order of a list of text data.

How to use

  1. Choose the reversal unit (characters, words, or lines).
  2. Enter the text you want to reverse.
  3. The reversed result appears automatically. Use the "Copy" button to copy it.

How the calculation works

This tool has three modes: reverse by character, by word, or by line. Character mode uses Intl.Segmenter to split the text into user-perceived characters (grapheme clusters) before reversing them. Flag emoji (๐Ÿ‡ฏ๐Ÿ‡ต) and skin-tone emoji (๐Ÿ‘๐Ÿฝ) are made of several code points. Reversing the raw code points turns a flag into a different country's flag or detaches the skin tone. Working with grapheme clusters keeps these as single characters. Word mode reverses the order of words separated by whitespace. The whitespace itself is treated as an element and reversed along with the words, so gaps such as double spaces are preserved. Line mode reverses only the order of the lines and leaves each line's contents unchanged.

Worked example

By character Input: Hello, World! Output: !dlroW ,olleH Input: ๆ—ฅๆœฌ๐Ÿ‡ฏ๐Ÿ‡ต Output: ๐Ÿ‡ฏ๐Ÿ‡ตๆœฌๆ—ฅ (the flag stays one character) By word Input: I love cats Output: cats love I By line Input: line 1 / line 2 / line 3 Output: line 3 / line 2 / line 1

Things to be aware of

  • Japanese sentences do not separate words with spaces, so word mode reverses whatever chunks are separated by spaces.
  • In word mode, punctuation moves together with the word before it ("Hello," stays "Hello,").
  • In older browsers without Intl.Segmenter, character mode falls back to reversing code points, and some emoji may break.

FAQ

Does this correctly reverse text containing emoji?

Yes โ€” emoji made of surrogate pairs are reversed as intact units without getting garbled.

How does "word" reversal work?

It reverses the order of space-separated words (each word's own letters stay in order). Languages without spaces between words, like Japanese, may not behave as expected.

Can I reverse the line order of multi-line text?

Yes โ€” choose "lines" to reverse the order of the lines while keeping each line's content unchanged.