TR
Text Reverser
Reverse text by character, by word order, or by line order — pick the mode you need.
More Text & Writing Tools
How to Use Text Reverser
Type or paste text into the box and choose one of three reversal modes: Reverse Characters flips the entire string back to front, Reverse Words keeps each word intact but flips their order, and Reverse Lines keeps each line intact but flips the order of the lines. The result updates live as you type or switch modes. Runs entirely in your browser.
About Text Reverser
"Reverse this text" is ambiguous without saying what unit you want reversed, and that ambiguity is exactly why this tool offers three distinct modes rather than one. Reversing a string character by character is the most literal interpretation and is genuinely useful for things like checking if a word or phrase is a palindrome, creating a simple text puzzle or novelty message, or working around software that displays text backwards. Reversing word order, by contrast, keeps every individual word spelled correctly and just flips which word comes first — useful for a specific kind of wordplay, or for sanity-checking sentence structure by reading it end to first. Reversing line order keeps every line's content untouched and only flips which line comes first, which is genuinely practical: log files are often written oldest-entry-first, and flipping them to newest-first (or vice versa) without touching the content of any individual log line is a common small task that this mode handles directly.
Character reversal is implemented with `Array.from(text).reverse().join('')` rather than the more naive (and broken) approach of splitting a string with `.split('')` and reversing that. The naive approach operates on UTF-16 code units, and any character outside the Basic Multilingual Plane — most emoji, for instance — is stored internally as a surrogate pair of two code units. Reversing those two units independently corrupts the character into two meaningless replacement glyphs instead of reversing it as a whole. `Array.from` iterates a string by Unicode code point instead of code unit, so a single emoji, and the vast majority of accented Latin letters (é, ș, ö and similar precomposed characters are each a single code point) survive character reversal intact and simply move to their new position in the reversed string.
That said, code-point-safe reversal is not the same as grapheme-cluster-safe reversal, and it is worth being precise about the difference. Some visual "characters" are actually built from more than one Unicode code point joined together — a combining diacritical mark applied to a base letter, an emoji with a skin-tone modifier, or a family emoji built from multiple person emoji joined with invisible zero-width-joiner characters are all, technically, several code points that render as one glyph. `Array.from`-based reversal treats each of those code points as a separate unit and reverses their order independently within the string, which can visually break a multi-code-point emoji or separate a combining accent from the letter it was attached to. Achieving fully correct grapheme-cluster reversal for every possible Unicode sequence requires the `Intl.Segmenter` API (or an equivalent grapheme-segmentation library) to first group code points into user-perceived characters before reversing those groups — this tool intentionally keeps things simple and dependency-free with code-point-level reversal, which correctly handles the overwhelming majority of real-world text (including all normal accented letters and simple, single-code-point emoji) while acknowledging this specific edge case rather than silently getting it wrong.
Reverse Words and Reverse Lines do not have this problem at all, since neither one reverses the characters within a word or line — they only reorder whole units (words, separated by whitespace and rejoined with single spaces; or lines, split and rejoined on newline characters) whose internal content is left completely untouched.
Details & Tips
How Reverse Characters works: `Array.from(text).reverse().join('')`. This iterates the string by Unicode code point (not UTF-16 code unit), so ordinary accented letters and single-code-point emoji reverse correctly.
Known edge case (documented explicitly, as this is a genuine limitation, not an oversight): multi-code-point grapheme clusters — a combining accent mark stacked on a base letter, an emoji modified with a skin-tone selector, or a joined emoji sequence (like a family emoji built from several person emoji connected by zero-width joiners) — are each made of more than one Unicode code point. Character reversal here reverses those code points individually rather than keeping the cluster together as one visual unit, which can visually corrupt that specific character in the output. This affects a small minority of real-world text; plain accented letters (é, ñ, ș, ö) and simple single-emoji input are unaffected because each is already a single code point.
How Reverse Words works: the text is split on runs of whitespace, empty fragments are discarded, the resulting word array is reversed, and the words are rejoined with a single space. Each word's internal spelling is untouched — only the order changes. Multiple original spaces between words are normalized down to one space in the output, since word order (not exact original spacing) is what this mode is about.
How Reverse Lines works: the text is split on newline characters, the resulting array of lines is reversed, and the lines are rejoined with newlines. Each line's content — including any internal spacing — is preserved exactly; only the top-to-bottom order of the lines changes.
Worked example — Reverse Characters on `Hello, World!`: output is `!dlroW ,olleH`.
Worked example — Reverse Words on `The quick brown fox`: output is `fox brown quick The`.
Worked example — Reverse Lines on a 3-line log fragment `first entry\nsecond entry\nthird entry`: output is `third entry\nsecond entry\nfirst entry`.
All three modes update live as you type or switch between mode buttons — there is no separate "run" step. A Copy button appears once there is a result, copying the current mode's output to your clipboard.
Frequently Asked Questions
What is the difference between Reverse Characters and Reverse Words?
Reverse Characters flips the entire string back to front, so words are spelled backwards too. Reverse Words keeps every word spelled correctly and only flips the order in which the words appear.
Does Reverse Lines reverse the text within each line?
No, each line's content is left completely untouched — only the top-to-bottom order of the lines is flipped. This is useful for reversing chronological order in a pasted log without corrupting individual entries.
Will reversing an emoji or accented character break it?
For most single-code-point characters — ordinary accented letters and simple emoji — reversal works correctly. Multi-code-point sequences like an emoji with a skin-tone modifier or a combining accent mark on a letter can visually break, since this tool reverses by Unicode code point, not by fully-composed grapheme cluster.
Why not just use JavaScript's split('').reverse().join('')?
That approach splits by UTF-16 code unit, which corrupts any character represented internally as a surrogate pair — most emoji, in particular. This tool uses Array.from(), which iterates by Unicode code point instead, correctly handling those characters.
Does Reverse Words preserve exact original spacing between words?
No, multiple consecutive spaces between words are normalized to a single space in the output, since the mode is about word order, not preserving exact original whitespace.
Can I check if a phrase is a palindrome with this tool?
Reverse Characters gives you the reversed string, which you can visually compare to the original — useful for a quick informal palindrome check, though it does not automatically ignore spaces, punctuation or capitalization the way a dedicated palindrome checker would.
Does the result update automatically as I type?
Yes, all three modes update live on every keystroke and immediately when you switch modes — there is no separate button to trigger the reversal.
Is my text uploaded anywhere?
No, all reversal happens locally in your browser using JavaScript. Nothing you type is sent to a server.
What happens if I reverse an empty textarea?
The result area shows a placeholder dash and no output is generated, since there is nothing to reverse.
Can I reverse just one line out of many, not the whole order?
Not directly — Reverse Lines flips the order of all lines together. To reverse the characters within a single line, paste just that line into Reverse Characters mode instead.
Does punctuation move with the word it was attached to in Reverse Words mode?
Yes, since punctuation attached to a word (like a trailing comma) is part of that whitespace-separated token, it moves together with the word when the word order is reversed.
Can I copy the reversed result?
Yes, a Copy button appears above the result once there is output, and copies the current mode's result to your clipboard.
Part of These Collections
Also Available As
text reverser, reverse text online, reverse words, reverse lines, backwards text generator, flip text, reverse string tool
Explore More Tools
View all toolsFound a Problem?
Let us know if something with Text Reverser isn't working as expected.
Something went wrong. Please try again.
Thanks — we'll take a look.