Text

Text Reverse

Reverse text: by characters, by words (word order), or by lines (line order).

This tool reverses text three different ways: by character (letters run in reverse order), by word (words swap places but stay intact), or by line (line order is flipped).

How to use it

Common uses

Things to keep in mind

A naive reversal by Unicode code point breaks composite characters (emoji with modifiers, some languages' combining diacritics) — a correct implementation splits text into grapheme clusters rather than individual code points.

Word-mode reversal doesn't change the letter order inside each word — it only rearranges the words themselves, not a character-level reversal.

Article about this tool: Text Reverse: why "reversing text" is harder than it sounds

Frequently asked questions

What are the different reversal modes?

Three modes exist: reverse character order, reverse word order while keeping each word intact, or reverse line order while keeping each line intact.

Why can character-level reversal produce unreadable results?

Reversing text character by character can break multi-byte Unicode sequences, emoji, or combining characters, producing a visually corrupted display; word- or line-level reversal doesn't have this problem since it moves whole blocks of text.

Is the entered text sent to a server?

No, reversal happens entirely in the browser in JavaScript, with no sending to a server.

What is a grapheme cluster?

It's what a person perceives as "one visible character," even though in Unicode it sometimes consists of several code points — a family emoji, for instance, is made up of several separate emoji joined by a special zero-width joiner character. A correct text reversal has to keep such clusters together as one unit.

Can an emoji be reversed and still stay valid?

Yes, if the reversal splits the string into grapheme clusters before changing their order, rather than into individual code points — then composite emoji (with skin-tone modifiers, country flags) stay intact after the operation.

Articles: Text

Case Converter: why different naming styles exist

Why one project writes variables in camelCase but files in kebab-case, and where these rules came from.

Text Diff: how algorithms find the difference between two texts

How a diff algorithm finds the minimal set of changes between two versions of a text.

Regular expressions: basic syntax and common patterns

How to read a regular expression, and how greedy matching differs from lazy matching.

Sorting and deduplicating lines: why it matters

Why numeric sorting putting "10" before "9" is a mistake, and how to avoid it.

String Escape: why the same text needs escaping differently

Why the same quote character gets escaped differently in a JS string, JSON, and a shell command.

CRLF vs LF: why line ending characters still matter

Why a file written on Windows can show as "entirely changed" in git on Linux.

Counting characters and words: why it's not always trivial

Why an emoji or an accented character can count as several characters at once.

Lorem Ipsum: where the placeholder text came from and why it exists

Why designers deliberately use "nonsense" text instead of real content in mockups.

Slugify: turning arbitrary text into a URL

How a title like "Hello, World!" turns into a URL-safe string like hello-world.

Markdown: why plain-text syntax beat rich text editors

Why developers choose to write documentation in Markdown instead of a rich text editor.

Whitespace and invisible characters: the hidden cause of weird bugs

Why two strings that look identical can fail to match because of an invisible character.

Text frequency analysis: why count how often words repeat

How letter frequency in ciphertext helps crack the simplest substitution ciphers.