Text reverser
Transformed in your browser Β· nothing is uploaded
Three reversals, and they are genuinely different operations: the characters, the order of the words, or the order of the lines. The character reversal iterates by code point rather than by UTF-16 unit, so a single emoji or a CJK character comes back whole instead of in pieces. Anything assembled from several code points is still reordered: a flag is two of them, and π³π± reversed is π±π³.
How to use the text reverser
Reversing characters is where an implementation detail becomes visible. Doing it naively splits a string into UTF-16 code units, which breaks any character outside the basic range; emoji and many CJK characters come apart into meaningless fragments. This iterates by code point instead, so any single character survives intact. What no reversal can preserve is a sequence built from several code points, because reordering them is the whole operation: a flag is two regional-indicator code points, so π³π± comes back as π±π³, which is a different flag; a skin-tone modifier follows its base emoji, so ππ½ comes back as the modifier followed by a bare thumb; and a family joined with zero-width joiners reverses into its members in the opposite order. Combining marks are the same problem in miniature β an accent stored separately from its letter ends up on the wrong letter. All of that is inherent to reversing text rather than a fixable bug, which is why the word and line reversals, which never touch the characters, are the safe options when the text contains any of it.
Reversing the word order is a different job and has none of those problems, because the words themselves are never touched. Punctuation moves with the token it is attached to, so "hello, world" becomes "world hello," with the comma still on the second word. The gaps are kept but mirrored, so a double space after the first word comes back before the last, and nothing is collapsed. The one behaviour to know is that a multi-line block is treated as a single sequence of words, because a line break is whitespace: the last line ends up first. When the lines matter β a list, a set of steps, a log β reverse the line order instead, which keeps each line intact and only changes their sequence.
Right-to-left text is the case where the result can look wrong when it is not. Arabic and Hebrew are stored in logical order and laid out right to left by the browser, so reversing the characters or the words changes the underlying string correctly and the rendered result is not the mirror image people expect. That is bidirectional layout doing its job, not the reversal failing.
What people use it for
- Putting the words of a sentence into the opposite order
- Reading a line that someone wrote backwards as a puzzle
- Flipping a log or a changelog so the newest entry sits at the top
- Checking a phrase for a palindrome by setting the two boxes side by side
- Spelling a name backwards for a username or a joke
- Reversing the letters inside each word by running the character pass and then the word pass
Questions
Characters reverses letter by letter; word order reverses the words and leaves each one readable; line order reverses the lines and leaves each line intact.
Single emoji and CJK survive; multi-code-point sequences do not. Iterating by code point rather than by UTF-16 unit protects one character, but a flag, a skin-tone modifier or a joined family is several code points and the reversal reorders them: π³π± comes back as π±π³, and ππ½ loses its modifier. Reversing the word or line order never touches any of them.
When an accent is stored as a separate combining mark, reversing moves it to the preceding character. That is inherent to reversing text.
Not in one pass. Reverse the characters, then reverse the word order, and you are there.
The gaps are kept but mirrored, so a double space after the first word comes back before the last. Nothing is collapsed.
It treats the block as one sequence, because a line break is whitespace, so the last line ends up first. Use reverse line order to keep the lines intact.
Yes. "hello, world" becomes "world hello,"; the comma is part of that token.
The characters or words do reverse, but right-to-left layout is the browserβs job, so the result may not look reversed on screen.
No practical one. The reversal runs in this tab and nothing is uploaded.
Reverse the characters and compare the two boxes by eye; there is no comparison step. Spaces, punctuation and case all count, so "A man, a plan, a canal: Panama" only matches once those are stripped out first.
No. Reversing reorders the characters you already have. Upside-down text swaps each one for a rotated look-alike glyph, Ι for a and so on, which substitutes glyphs instead of reordering them. The fancy text generator does that.
Reversing the line order splits on CRLF or LF and rejoins with LF, so a file saved on Windows comes back with Unix line endings.
A file that ends with a newline has an empty last line, and reversing the order puts it first. Delete it, or drop the trailing newline before pasting.