Reverse Text

Flip text backwards, reverse word order or line order.

Three ways to reverse text

Reversing text can mean three quite different things, and this tool does all of them. Which you want depends entirely on what you are trying to achieve.

ModeInputOutput
By characterHello WorlddlroW olleH
By wordHello World AgainAgain World Hello
By lineLine 1, Line 2, Line 3Line 3 ⏎ Line 2 ⏎ Line 1

Key takeaways

  • Character reversal flips the whole string; word reversal keeps words intact.
  • Line reversal is useful for flipping a chronological log or list.
  • Reversal is its own inverse - apply it twice and you get the original back.
  • Emojis and accented characters can break if reversed naively by code unit.
  • Reversed text is not encryption and offers no security whatsoever.

What people use it for

  • Puzzles and games - word games, escape rooms, treasure hunts.
  • Testing text handling in software, particularly right-to-left rendering.
  • Novelty social media posts, where reversed text catches the eye in a feed.
  • Flipping a chronological list so the newest entry appears first.
  • Checking palindromes - a word reads the same reversed if it is one.
  • Teaching string manipulation, since reversal is the classic first exercise.

The Unicode problem

Reversing a string is the textbook example of a programming task that is simple in theory and full of traps in practice. Naively reversing by code unit corrupts anything outside the basic Latin range.

TextNaive reversalCorrect reversal
abccbacba
cafééfacéfac (if precomposed)
café (combining accent)́efac - accent detacheséfac
😀🎉Corrupted characters🎉😀
👨‍👩‍👧Family emoji falls apart👨‍👩‍👧

The problem is that one visible character can be several code units. Reversing them individually splits emoji sequences and detaches combining accent marks from their base letters. This tool reverses whole graphemes, so it gives the right-hand column.

Why this matters beyond curiosity. "Reverse a string" is one of the most common programming interview questions, and the naive one-line answer is wrong for any text containing emoji or combining marks. Grapheme-aware reversal - splitting by what users perceive as characters - is the correct approach.

Palindromes

A palindrome reads the same forwards and backwards. To test one properly, strip punctuation, spaces and capitalization first, then compare against the reversal.

  • Words: level, radar, civic, rotator, racecar
  • Phrases: "A man, a plan, a canal: Panama"
  • Numbers: 12321, 45654
  • Dates: 22/02/2022 reads the same either way

Reversal is not obfuscation

Do not use reversed text to hide anything. It takes one function call to undo, offers zero protection, and is trivially recognisable. It is not encryption, not encoding and not obfuscation - it is a party trick. For genuine encoding use Base64, and for actual security use proper cryptography.
Everything happens in your browser. Your text is processed entirely on your own device using JavaScript. Nothing is uploaded, stored or logged, which means you can safely paste confidential drafts, client work or personal notes. Closing the tab discards everything.

Frequently Asked Questions

How do I reverse text?

Paste your text into the box above and choose a mode. Character mode flips the whole string so "Hello" becomes "olleH". Word mode reverses the order of words while keeping each word readable. Line mode flips the order of lines.

What is the difference between reversing characters and words?

Character reversal flips every letter, making the text unreadable - "Hello World" becomes "dlroW olleH". Word reversal keeps each word intact and only changes their order - "Hello World Again" becomes "Again World Hello".

Can I reverse the reversed text back?

Yes. Reversal is its own inverse, so applying the same mode twice returns the original text exactly. This tool reverses whole graphemes, so emoji and accented letters survive the round trip too; naive code-unit reversal elsewhere can corrupt them on the first pass.

Why do emojis break when text is reversed?

Because a single visible emoji is often several underlying code units, and composed emojis such as family groupings use many. Reversing them individually splits the sequence apart. Correct reversal has to work on graphemes - what users perceive as one character - rather than code units.

How do I check if something is a palindrome?

Strip out punctuation, spaces and capitalization, then compare the cleaned text with its reversal. "A man, a plan, a canal: Panama" becomes "amanaplanacanalpanama", which reads identically in both directions.

Is reversed text a form of encryption?

No, not remotely. It takes one function call to undo and is instantly recognisable. It provides no security at all. For encoding use Base64, and for anything requiring actual confidentiality use proper cryptography.

Does this work with non-English text?

Yes for most scripts. Text with combining accent marks or complex emoji needs grapheme-aware handling to reverse correctly, which this tool uses; naive implementations produce corrupted output in exactly that case. Right-to-left scripts such as Arabic and Hebrew are reversed character by character like any other text.

Is my text sent to a server?

No. Everything runs in your browser and nothing is uploaded or stored. Closing the tab discards it.

Related Calculators