devtools

Reverse Text

Reverse text by characters, words, or lines online. The character reverse is emoji-safe, so surrogate pairs stay intact. Free, private, and in your browser.

Runs entirely in your browser — your data never leaves your device.

How to use Reverse Text

What it does & when you need it

Reversing text sounds trivial until you try it on anything with an emoji, and a naive one-liner mangles the result. This tool reverses text three different ways — by character, by word, or by line — and does the character reversal safely, so astral symbols and emoji survive intact. It updates as you type and copies with a click.

People reach for text reversal for puzzles and ciphers, for flipping a list of lines into the opposite order, for reversing word order in a sentence, or simply to test how their own code handles Unicode. Whatever the reason, it runs entirely in your browser with nothing uploaded.

How to use

  1. Paste or type into the input buffer, press Sample for a multi-line example, or Upload a text file.
  2. Pick a mode from Reverse by: Characters, Words, or Lines.
  3. The reversed buffer updates live. Press Copy result or Ctrl/Cmd + Enter to copy it.

Things worth knowing

Character reversal is code-point aware. The classic trick, str.split('').reverse().join(''), splits a string into UTF-16 code units. That tears a surrogate pair — the two units that make up an emoji — in half, producing broken output. This tool iterates with Array.from, which walks whole code points, so a grinning face or a mathematical symbol comes back whole rather than scrambled.

Word mode reverses order, not spelling. It flips the sequence of words within each line while keeping every word spelled the way you wrote it, and it preserves the spacing and line breaks. Punctuation travels with the word it is attached to, so "hello, world!" becomes "world! hello,".

Line mode flips top to bottom. It reverses the order of the lines and normalises Windows and old-Mac line endings to a plain newline along the way, so a list read bottom-up comes out cleanly.

Note that even code-point-aware reversal can split a grapheme cluster — an emoji with a skin-tone modifier is several code points — so extended sequences may recombine differently. For most text the result is exactly what you expect.

From here you might count the result, sort lines, or change its case.

Examples

Reverse characters

stressed

Character mode turns "stressed" into "desserts".

Reverse word order

the quick brown fox

Word mode flips the order to "fox brown quick the", keeping each word intact.

Reverse line order

first
second
third

Line mode flips top to bottom: third, second, first.

Frequently asked questions

Does reversing characters break emoji?

No. The naive trick str.split("").reverse().join("") splits a string into UTF-16 code units and tears a surrogate pair — the two units that make up an emoji — in half, producing garbage. This tool iterates with Array.from, which walks whole code points, so emoji and astral symbols are reversed intact.

What is the difference between reversing words and characters?

Character mode reverses the individual characters, so "stressed" becomes "desserts". Word mode keeps each word spelled the way you wrote it and only flips the order of the words within each line, so "the quick fox" becomes "fox quick the", preserving the spacing.

How does line mode handle multi-line text?

Line mode reverses the order of the lines top to bottom while leaving each line's contents alone. It also normalises Windows (CRLF) and old-Mac (CR) line endings to a plain newline, so a list pasted from anywhere comes out cleanly in reverse order.

Can reversing still split an emoji made of several parts?

Code-point-aware reversal keeps individual code points whole, but a single glyph can be several code points — an emoji with a skin-tone modifier, or a flag built from two regional indicators. Reversing those code points can recombine them differently. For ordinary text and single-code-point emoji the result is exactly what you expect.

Is anything uploaded?

No. The reversal runs entirely in your browser with no network request, so whatever you paste stays on your machine and the tool keeps working offline.