3tej home

What is Reverse Text?

A Reverse Text computes reverse text from the inputs you provide. It applies the standard formula to the values you enter and returns the result instantly, without sending any data to a server. Flip any text backwards character-by-character. The tool.

Reverse Text

Flip any text backwards character-by-character. Handles emoji correctly thanks to Unicode-aware splitting.

Browser-onlyInstantFree foreverWorks offlineNo signup
← Utilities

TLDR

Paste anything and press Reverse to get it back-to-front. Uses spread-iteration so emoji and accented letters stay intact rather than splitting in half.

0 words · 0 chars
Runs entirely in your browser. No upload, no signup, no logging. Output is for personal or commercial use; we don't claim any rights.

About text reversal

A reverse-text tool flips a string so that the last character becomes the first, the second-to-last becomes the second, and so on. It is the most basic non-identity string operation and shows up in interview questions, palindrome checks, brain-teaser puzzles, escape-room clues, and right-to-left display experiments. The naïve implementation in JavaScript, str.split('').reverse().join(''), dates from the language's first standard library and has appeared in beginner tutorials since 1996, but it has a subtle bug: it splits on UTF-16 code units rather than Unicode code points, so emoji and other astral characters get torn in half.

This tool uses the modern, Unicode-aware approach: it converts the string to an array with Array.from(str) or the spread iterator, which walks proper Unicode code points and keeps surrogate pairs together. Where the browser exposes Intl.Segmenter('en', {granularity: 'grapheme'}), we also segment grapheme clusters so multi-codepoint emoji (family, profession, regional flags) reverse as one unit instead of scrambling.

How the reverser works

// Code-point safe one-liner
output = [...input].reverse().join('')

// Grapheme-cluster safe (handles ZWJ emoji sequences)
const seg = new Intl.Segmenter('en', {granularity: 'grapheme'})
output = [...seg.segment(input)].map(s => s.segment).reverse().join('')
  • Code-point segmentation. The spread operator iterates code points (using the StringIterator from ECMAScript 2015) rather than UTF-16 16-bit code units, so a rocket emoji at U+1F680 stays as one unit instead of becoming two unpaired surrogates.
  • Reverse the array. Array.prototype.reverse() mutates in place in O(n) time, walking from both ends toward the middle.
  • Rejoin. join('') concatenates with no separator, producing a single output string of the same code-point length as the input.
  • Involutive. Reversing the output again returns the original, with one caveat: NFD decomposed accents end up before their base letter and stay that way unless you renormalise with str.normalize('NFC').

Worked example

Input: a mixed string with ASCII, an accented letter, and an emoji.

Café 2026 🚀
  1. Spread to code points. ['C', 'a', 'f', 'é', ' ', '2', '0', '2', '6', ' ', '🚀']. The rocket is one code point at U+1F680; in UTF-16 storage it is a surrogate pair but the spread iterator yields it as one element.
  2. Reverse the array. ['🚀', ' ', '6', '2', '0', '2', ' ', 'é', 'f', 'a', 'C'].
  3. Join. Concatenate with empty separator.
Result: 🚀 6202 éfaC
The rocket emoji stays whole, the precomposed é stays attached, and reversing the result a second time returns Café 2026 🚀 byte for byte.

Contrast with the naive split: 'Café 2026 🚀'.split('').reverse().join('') on Chrome 119 yields the same visible result for this string because Café uses precomposed é, but a string built with NFD decomposed accents or a flag emoji (which uses two regional indicator code points) would scramble.

Reversal under different segmentations

Segmentation levelMethodEmoji safeDecomposed accent safe
UTF-16 code unitsstr.split('').reverse()NoPartial
Unicode code points[...str].reverse()Single-codepoint onlyNo
Grapheme clustersIntl.Segmenter('en', {granularity:'grapheme'})Yes (ZWJ included)Yes
Wordsstr.split(/\s+/).reverse()n/an/a
Linesstr.split(/\r?\n/).reverse()n/an/a

Pitfalls to watch for

  • Decomposed accents jump positions. a + U+0301 combining acute renders as á. After reversal the combining mark sits before the base letter and attaches to whatever was previously to its right. Normalise to NFC before reversing if you handle mixed input.
  • Flag emoji split in two. The Indian flag is two regional indicator letters (IN). Each is a separate code point, so without grapheme-level segmentation the reversal produces NI, the Nicaraguan flag. Use the Intl.Segmenter path.
  • Bidi control characters strand. U+202E right-to-left override and U+202D left-to-right override change the display order of everything after them. Reversal moves them mid-string and can produce surprising visual results.
  • URLs become invalid. Reversing https://example.com/path produces htap/moc.elpmaxe//:sptth, which is not a parseable URL.
  • It is not encryption. Reversed text is decoded instantly by any tool, including this one. Use proper cryptography for anything sensitive.
  • Word-reversal needs a different tool. If you want sentence-with-reversed-words rather than reversed characters, split on whitespace, reverse the array, and rejoin with a space.

Related text utilities

Frequently asked questions

Does the reverser handle emoji and astral Unicode characters?

Yes. The implementation uses Array.from(string) which iterates UTF-16 surrogate pairs as single code points, so emoji like rocket and clap stay intact rather than splitting into the two unpaired halves a naive .split('').reverse() would produce. Complex emoji built from ZWJ sequences (family emoji, professions, flag tags) reverse as one unit because we segment them with Intl.Segmenter where available.

Does it reverse word order or character order?

Character order. The last character of the input becomes the first character of the output, so 'Hello world' becomes 'dlrow olleH'. To reverse word order ('world Hello'), split on whitespace, reverse the array, and rejoin; this tool does not do that because the result is rarely what users actually want.

What happens to combining diacritics like a-circumflex written as two code points?

If the diacritic is precomposed (U+00E2 a-circumflex as one code point), it reverses cleanly. If the same letter is decomposed as U+0061 a plus U+0302 combining circumflex, the reversal places the combining mark before the base letter, which renderers will attach to the wrong character. Normalise input to NFC with string.normalize('NFC') first if you mix accented scripts.

Is reversed text a form of encryption or hiding?

No, and you should not treat it as one. Reversing is a one-line operation any browser, terminal, or text editor can undo instantly. Use it for puzzles, palindrome checking, RTL display tests, or as an Easter-egg cipher in offline notes. Do not use it to obscure passwords, secrets, or anything you would not also write in plain text.

Does it work for Arabic, Hebrew, and other right-to-left scripts?

Mechanically yes: every Unicode code point reverses regardless of script. Visually it gets confusing because Arabic and Hebrew already render right-to-left in the browser, so a reversed Arabic string displays left-to-right at the byte level but the renderer may also bidi-flip it. Use a monospace editor with bidi disabled to inspect the underlying order.