The reverse text generator above turns any string back to front, and it does so in five different senses of the word "reverse". You can mirror the whole string character by character, keep every word intact but flip their order, keep every line intact but flip the order of lines, reverse the letters inside each word while leaving the words in place, or reverse the words inside each line while leaving the lines in place. Those five operations produce five completely different results from the same input, and choosing the wrong one is the most common reason a reversal "does not work".
Arb Digital publishes this with the rest of its free developer utilities because reversing text is one of those jobs that looks like a one-liner and quietly is not. A naive reversal in almost any language splits the string into fixed-size code units and walks them backwards, which shreds emoji, breaks accented letters away from the letters they belong to, and scrambles anything written in a script that uses combining marks. This page reverses by grapheme cluster instead, so what comes out is made of the same visible characters that went in.
What This Reverse Text Generator Does
It reads whatever is in the box, splits it according to the mode you picked, reverses the resulting list, and joins it back together. The counters underneath report four different measures of length at once: grapheme clusters, which is what a reader would call "characters"; code points, which is what a language like Python counts; words, split on whitespace; and lines. Those four numbers diverge for real-world text, and seeing them side by side is often more useful than the reversal itself.
Three optional switches change the behaviour. Grapheme-safe reversal is on by default and is what keeps a family emoji or a letter with a stacked diacritic in one piece. Case preservation reapplies the original capitalisation pattern positionally, so a sentence that started with a capital still starts with a capital after reversal rather than ending with a stray one. Punctuation preservation strips a trailing run of full stops, commas, exclamation marks, question marks, semicolons and colons before reversing, then reattaches it, which is what most people expect when they reverse a sentence and are surprised to find a full stop at the front.
Everything happens in your browser. There is no upload, no server round trip, and no request of any kind — the page does not call out to anything after it loads, so text you paste here never leaves your machine. That matters if the string you are reversing came from a log file, a customer record, or a credential you are inspecting.
How to Use It
- Paste your text. Multi-line input is fine; the line-based modes depend on it.
- Pick the mode. If you want a mirror image of the string, use characters. If you want a list in the opposite order, use lines. If you want a sentence read backwards word by word, use words.
- Leave grapheme safety on unless you are deliberately testing what a byte-level reversal does to your data.
- Tick case or punctuation preservation if you are reversing prose rather than data. Leave both off for anything you intend to reverse back again.
- Copy from the full output box, or press "Use output as input" to chain another pass and confirm the round trip returns your original.
How the Reversal Is Actually Calculated
The core operation is a split, a reverse and a join. What varies is the unit you split on. In character mode the tool builds a list of grapheme clusters, reverses the list, and concatenates it. In word mode it splits on runs of whitespace, reverses the array of words, and rejoins with single spaces. In line mode it splits on newline characters, reverses, and rejoins with newlines. The two hybrid modes apply a word or character reversal inside each element while leaving the outer order alone.
Grapheme clustering is the interesting part. A JavaScript string is a sequence of UTF-16 code units, and a single code unit is only sixteen bits. Anything above U+FFFF — which includes most emoji, many historic scripts and a large block of mathematical letters — is stored as a surrogate pair of two code units that mean nothing on their own. Reversing code units puts the low surrogate before the high one, and the result is two replacement characters where an emoji used to be. Splitting by code point fixes that, but it still separates a base letter from its combining accents, because those are independent code points that follow the letter they modify. The rule for grouping code points into what a reader perceives as one character is defined in Unicode Standard Annex #29, Unicode Text Segmentation, and this tool uses the browser's built-in segmenter where it is available and a combining-mark fallback where it is not.
Why Reversed Text Is Not the Same as Right-to-Left Text
People sometimes reach for a reverser when what they actually have is a bidirectional text problem. Arabic and Hebrew are stored in logical order — first letter first — and the display engine lays them out right to left at rendering time. The stored string is not reversed and must never be reversed. If you reverse an Arabic string to "fix" its display, you have corrupted the data while leaving the display unchanged, because the renderer will then flip your reversed string back and show it backwards.
The algorithm that decides the visual order is specified in Unicode Standard Annex #9, the Unicode Bidirectional Algorithm. If mixed left-to-right and right-to-left text is displaying in an order you did not expect, the fix is almost always an isolate or an embedding control, not a reversal. This tool will happily reverse an Arabic string because that is what you asked it to do, but the counters will show you that nothing about the character content changed except the order, which is usually enough to make the problem obvious.
Why the Four Counters Disagree
Take a short string containing one emoji made of a base emoji plus a skin-tone modifier plus a zero-width joiner sequence. A reader counts one character. The grapheme counter agrees. The code-point counter might say seven. A UTF-16 length in JavaScript might say eleven, and a UTF-8 byte count might say twenty-five. None of those numbers is wrong; they answer different questions.
Which one you need depends on what is downstream. A database column declared as varchar(280) may be counting bytes, code points or characters depending on the engine and the collation, and the difference decides whether a user's post is rejected. UTF-8's variable-width encoding, where a code point occupies one to four bytes, is defined in RFC 3629, UTF-8, a transformation format of ISO 10646. When you are sizing a field, check which unit the limit is expressed in before you trust any single number. Our character counter reports the same breakdown without the reversal, and the unicode character converter shows you the individual code points behind a confusing string.
Real Uses Beyond Novelty
Reversal is a genuine engineering tool more often than its reputation suggests. Reversing a domain name into label order — com.example.www — is how DNS-style hierarchies and Java package names are sorted so that related names group together. Reversing a string is the standard trick for testing palindromes, and comparing a reversed copy against the original is how a great many interview questions and a smaller number of real validators work.
Line reversal is the quickest way to read a log file newest-first when the tool that produced it only appends. Word-order reversal inside a line is useful for converting "Surname, Forename" lists and for spotting whether a parser is splitting on the delimiter you think it is. Reversing the letters inside each word while keeping word order is a cheap readability test: if a reader can still parse the sentence, your text is more predictable than you thought.
There is also a testing use. Reversing a string is a fast way to generate input that is the same length and the same byte composition as the original but is guaranteed not to match any cached value, which makes it handy for checking that a lookup is really hitting the database rather than a stale cache. If you need output that looks scrambled rather than mirrored, the Caesar cipher translator shifts letters instead, and the lorem ipsum generator produces filler that will never accidentally read as a real sentence.
Round-Tripping and When It Fails
A pure character reversal is its own inverse: reverse twice and you get the original back, exactly. That property is the easiest way to check that a reverser is not damaging your data, and it is why the "Use output as input" button exists. Paste, reverse, reverse again, and compare against what you started with.
The round trip breaks the moment you enable the convenience options, and that is by design rather than a bug. Case preservation rewrites capitalisation, so the information about which letters were originally capital is gone. Punctuation preservation moves characters that a strict reversal would have relocated. Word mode collapses runs of whitespace to single spaces, so tabs and double spaces do not survive. Line mode preserves the lines but not a trailing newline. If you need a reversal you can undo, use character mode with all three switches off.
One more subtlety: even grapheme-safe reversal is not guaranteed to be visually identical after a round trip for text in complex scripts, because some shaping rules depend on neighbouring characters. The code points come back correct, which is what matters for storage and comparison, but a rendered screenshot taken before and after may differ in ligature choice.
Where This Sits Among Our Other Text Tools
This page does one thing: it changes the order of things. It does not change the characters themselves. If you want the characters replaced with rotated look-alikes so the text reads upside down, that is the upside down text generator, which is a substitution rather than a reordering — and confusingly, most upside-down text also needs a reversal, which is why the two tools are often mistaken for each other. For styled Unicode letterforms, use the fancy text generator. For turning a title into a URL segment, the slug generator handles the transliteration and hyphenation rules that a reversal has nothing to do with.
Arb Digital builds and maintains sites that do not break on an emoji, an accent or a right-to-left name. If encoding bugs keep reaching your users, we can help.
See Web Design & Development Talk to Arb DigitalCommon Mistakes to Avoid
- Reversing by code unit — a plain loop over string indices in JavaScript, Java or C# splits surrogate pairs and destroys every emoji above U+FFFF.
- Reversing right-to-left text to fix its display — Arabic and Hebrew are stored in logical order; reversing corrupts the data and does not change what the reader sees.
- Expecting a round trip after enabling case or punctuation preservation — both options discard information, so only a plain character reversal is exactly invertible.
- Assuming word mode preserves spacing — it splits on whitespace runs and rejoins with single spaces, so tabs and alignment padding do not survive.
- Treating a reversed string as obfuscation — reversal is trivially undone by anyone, offers no confidentiality, and should never be used to hide a key, a token or a password.
Related Free Tools From Arb Digital
Count what you are working with using the character counter or the word counter, inspect the individual code points with the unicode character converter, flip characters rather than order with the upside down text generator, and shift letters with the Caesar cipher translator. For encoding rather than reordering, the Base64 encoder and decoder is the right page. Everything else lives in the free online tools hub.
Frequently Asked Questions
No. The reversal runs entirely in your browser using ordinary JavaScript, and the page makes no network request after it loads. Nothing you paste is transmitted, logged or stored.
Because it reversed by code unit rather than by grapheme cluster. Emoji above U+FFFF are stored as two UTF-16 surrogates, and putting them in the wrong order produces replacement characters. Keep the grapheme option ticked here and the emoji survives.
Character mode mirrors the entire string, so every word is also spelled backwards. Word mode keeps each word readable and only changes the order they appear in. Most people asking to reverse a sentence want word mode.
Yes, if you used character mode with the case and punctuation options switched off. That combination is exactly invertible. The convenience options discard information, so a second pass will not restore the original.
Almost never. Those scripts are stored in logical order and laid out right to left by the display engine. Reversing the stored string corrupts it. Display problems in mixed-direction text are solved with bidirectional isolate controls instead.
They measure different units. Grapheme clusters are what a reader calls characters, code points are what many programming languages count, and words and lines are split on whitespace and newlines. Field limits in databases and APIs may be expressed in any of them.
No. Reversal is a public, deterministic transformation that anyone can undo instantly. It provides no confidentiality whatsoever and must never be used to conceal a password, key or token.
Yes. Line mode reverses the order of lines while leaving each line intact, which is the fastest way to read an append-only log newest-first or to flip a ranked list.