ToolBench

Text

Reverse text

Three kinds of reversal, because “reverse this” means different things. Character mode mirrors the string; word mode keeps the words but flips their order; line mode turns the list upside down.

How to use it

  1. Paste the text you want to flip.
  2. Pick characters, words or lines.
  3. The result replaces the output box instantly.
  4. Copy it or keep editing the input.

Why reversing text is harder than it looks

Reversing byte by byte corrupts every multi-byte character. Reversing by UTF-16 code unit splits emoji and anything outside the basic plane into two broken halves. Even reversing by code point is not always right: a letter with a combining accent is two code points that must keep their order, and Arabic or Hebrew carries directionality that a naive reversal destroys entirely.

What it is genuinely useful for

Reversing is a cheap test of whether a text pipeline handles Unicode correctly — if the output contains replacement characters, something upstream is broken. It also makes suffix searches trivial (find the last occurrence of a string by reversing and searching for the reversed prefix), and it is the standard move in a certain class of word puzzle.

A ten-second Unicode check

Reversing a string is the cheapest way to find out whether a text pipeline is honest about encoding. If the reversed output contains question marks or replacement glyphs, something upstream decoded bytes with the wrong character set — usually Latin-1 where UTF-8 was intended. Reversing again should return the original exactly; if it does not, the pipeline is lossy.

It is also the standard trick for suffix matching: to find the last occurrence of a term without a reverse search API, reverse both the text and the term, run an ordinary search, and map the index back.

Frequently asked questions

Why does character mode keep emoji intact?

The string is split by Unicode code points rather than UTF-16 units, so a single emoji or accented letter is not torn into two broken halves.

What is word reversal good for?

It is the quickest way to see whether two sentences contain the same words in a different order, which is useful when diffing rewritten copy.

Does it change the original text?

No. The input box is untouched; only the output field changes.

Can it reverse a whole file?

Paste it in — a few hundred kilobytes is fine. Very large inputs get slow because the browser re-renders the text area on every keystroke.

Why did my emoji turn into two broken characters?

The string was reversed by UTF-16 code unit rather than by code point, splitting the surrogate pair. Any correct implementation reverses whole code points.

Can reversing be undone exactly?

For plain text, yes. For text with combining marks or bidirectional scripts, no — reversing twice does not restore the original order.