Text Reverser
This is a palindrome
Ignoring case, spaces and punctuation, the text reads the same in both directions. The palindrome checker covers the normalisation rules in full and reports where a near-miss first diverges.
The reverser flips text four ways: character by character, word order across the whole text, word order within each line, or line order. Character reversal works on grapheme clusters rather than code units, which is what stops emoji and accented letters from falling apart.
How it works
The four modes are genuinely different operations. Reversing characters turns "Hello" into "olleH". Reversing word order turns "the lazy dog" into "dog lazy the" with each word still spelled forwards. Reversing lines leaves every line untouched and flips their sequence.
Character reversal uses Intl.Segmenter to split by grapheme cluster, what a reader thinks of as one character. A naive reversal splits by code unit, which separates a combining accent from its letter and tears an emoji with a skin-tone modifier into its component code points.
- Characters: for puzzles, palindrome checking and mirror-writing effects.
- Word order across the whole text: treats the text as one stream of words.
- Word order within each line: keeps lines separate, reversing the words inside each.
- Lines: reverses the sequence of lines, useful for flipping a chronological log.
When character mode produces text that matches the input (ignoring case, spaces and punctuation) the page says so, because palindrome checking is what most people are actually doing.
Examples
A palindrome
Text
Never odd or even
Mode
Characters
Result
neve ro ddo reveN: flagged as a palindrome
Ignoring case, spaces and punctuation the two read identically, which is the standard definition of a palindrome.
Word order versus characters
Text
the lazy dog
Result
Characters: god yzal eht · Words: dog lazy the
The two modes give completely different results. Word reversal keeps every word readable; character reversal does not.
An accented letter
Text
café
Mode
Characters
Result
éfac
Where the é is written as e plus a combining accent, a code-unit reversal moves the accent onto the c. Segmenting by grapheme keeps the pair together.
Frequently asked questions
Why do my emoji survive here but break in other reversers?
Because reversal is done by grapheme cluster rather than by code unit. Many emoji are several code points, a base character plus a skin tone or a zero-width joiner sequence, and reversing those individually scatters them into unrelated symbols.
What is the difference between reversing words and reversing characters?
Reversing characters spells everything backwards: "the lazy dog" becomes "god yzal eht". Reversing word order keeps each word spelled forwards and flips their sequence: "dog lazy the". They are separate modes because they are separate operations.
How does the palindrome check work?
It compares the input to the character-reversed output after lowercasing and removing everything that is not a letter or digit. That is the usual convention, so "A man, a plan, a canal: Panama" registers as a palindrome, punctuation and all.
Can I make text display right-to-left instead?
No. Genuine right-to-left display uses Unicode direction marks and is what Arabic and Hebrew need. Reversing characters produces text that only looks backwards and will not behave correctly anywhere.
Does reversing twice give me back my original?
For characters, words and lines, yes. Each is its own inverse. The one exception is text with unusual whitespace, where trimming during display can make the round trip differ by a space.