Text Reverser

Reverse text three ways: character by character, word by word, or line by line. The character mode is where this differs from most reversers, and the difference is visible the moment any emoji is involved. The usual one-liner splits a string into UTF-16 units, which slices every emoji in half and leaves you with replacement boxes. Splitting by code point is better but still pulls a family emoji apart into individual people and detaches a combining accent from its letter, moving it onto whatever now precedes it. This reverses by grapheme — what a person would call a character — so an emoji stays an emoji and é stays é. Word reversal keeps your line structure and original spacing; line reversal normalises Windows and Unix line endings first so both behave the same.

Why the unit matters

ApproachResult on an emoji
split("")Cuts it in half — replacement boxes
[...text]Splits joined emoji into pieces
Grapheme segmentationStays intact — what this uses
Combining accentStays attached to its letter

When to use it

  1. Reverse a string for a puzzle, a test case or a CTF.
  2. Flip the order of words in a line.
  3. Reverse the order of lines in a list.
  4. Check whether a phrase is a palindrome.
  5. Produce mirrored text for a design or a joke.

How to Use

  1. Paste your text.
  2. Choose characters, words or lines.
  3. Copy the reversed result.

Features

  1. Reverse by character, word or line
  2. Grapheme-accurate, so emoji and accents survive
  3. Word mode keeps line structure and spacing
  4. Line endings normalised across platforms
  5. Live output
  6. 100% client-side

FAQs

Is my text uploaded?

No. It is reversed in your browser.

Why do other reversers break my emoji?

Because they split the string into UTF-16 units, which cuts every emoji exactly in half and leaves two fragments that are not characters. Even splitting by code point breaks emoji built from several joined together, like a family or a flag. Grapheme segmentation is the only unit that matches what you see.

What happens to accented letters?

They survive. An accent written as a combining mark belongs to the letter before it, so naive reversal moves it onto the wrong letter. Reversing by grapheme keeps the pair together.

Does word reversal change my spacing?

No. Whitespace runs are kept as their own tokens, so double spaces and tabs come back as they were rather than being collapsed.

How are Windows line endings handled?

Normalised before reversing, so a file authored on Windows behaves identically to one authored on Unix rather than leaving carriage returns stuck to the wrong lines.

Technical Details

Character reversal is the one operation here with a genuine correctness trap, and almost every implementation on the web falls into it. Writing text.split("").reverse().join("") splits the string into UTF-16 code units, which cuts every astral character — every emoji, every musical symbol, much of CJK extension — exactly in half, producing two lone surrogates that are not characters at all and render as replacement boxes. Using the spread operator instead splits by code point, which fixes astral characters but still breaks anything built from several: a family emoji joined by zero-width joiners comes apart into its component people, and a combining accent is separated from the letter it modifies, landing on whatever letter now precedes it. The only correct unit is the grapheme cluster — what a person would call a character — which requires Intl.Segmenter. That is what is used here, with a code-point fallback for runtimes that lack it, which is still better than splitting UTF-16 units. Word reversal preserves line structure and reverses only within each line, keeping the whitespace runs as tokens so the output has the same spacing as the input rather than being collapsed to single spaces. Line reversal normalises the three line-ending conventions first, so a file authored on Windows reverses the same as one authored on Unix rather than leaving stray carriage returns attached to the wrong lines. Everything runs in your browser.

Text Utilities

Text Utilities

  • Text to Handwriting
  • Remove Duplicate Lines
  • Text Case Converter
  • Whitespace Remover
  • Text to ASCII Art
  • Line Sorter
  • Random Text Generator
  • Word Frequency Counter