Reverse text character order
How to write text backward by reversing character order, how that differs from mirrored, upside-down, bidirectional and CSS effects, and where reversed text breaks.
The direct answer
Reversing character order means rewriting a string so the last character comes first and the first comes last. "hello world" becomes "dlrow olleh". The result is ordinary text. Every character is still a standard letter, digit or symbol, just in the opposite sequence. It can be copied, pasted, stored and searched like any other text, although it no longer reads naturally.
Several other effects are often described as backward text, and they work differently. Choose based on whether you want the stored text to change or only its appearance.
| Approach | What changes | Stored text | Effect after plain-text paste |
| Character-order reversal | Sequence of characters | Changed: real characters in reverse order | Kept, because it is ordinary text |
| Glyph mirroring by substitution | Each letter swapped for a look-alike character that resembles a flipped form | Changed: different Unicode characters, often from other scripts or symbol blocks | Usually kept, but display depends on fonts in the destination |
| Upside-down substitution | Letters swapped for look-alikes that resemble a 180° rotation, usually also reversed in order | Changed: substitute characters | Usually kept, but display depends on fonts in the destination |
| Bidirectional override | An invisible control character (such as RIGHT-TO-LEFT OVERRIDE, U+202E) makes the following text display right to left | Original order unchanged, plus a hidden control character | Unpredictable: the control may be kept, stripped or neutralized |
| CSS visual styling | A style rule such as a horizontal flip transform or right-to-left direction changes only how a web page draws the text | Unchanged | Lost: copying yields the original, unflipped text |
Order reversal and glyph mirroring answer different needs. Reversal changes which character comes where but leaves each letter facing normally. Mirroring makes each letter look flipped, which on its own does not change the reading order. A true mirror image, as in a reflection, needs both: reversed order and flipped glyphs. Unicode has no flipped-glyph counterpart for every letter, so substitution-based mirroring is always approximate. Some letters have no convincing look-alike and are left unchanged or replaced with a rough match.
Choosing the scope of the reversal
Decide what unit you want reversed before you transform anything:
- Whole text: every character in reverse, so the final word comes first and is itself spelled backward.
- Each word in place: words keep their positions but each is spelled backward ("hello world" becomes "olleh dlrow").
- Word order only: words stay correctly spelled but appear in reverse sequence ("hello world" becomes "world hello").
- Line by line: each line is reversed separately. Reversing a multi-line block as a single string also reverses the order of the lines.
Reversing by visible character, not by code unit
What a reader sees as one character can be stored as several pieces. An accented letter may be a base letter followed by a combining accent. Many emoji are made of several code points, including skin-tone modifiers, flag pairs, and sequences joined by a zero-width joiner. Reversing those pieces individually can detach accents onto the wrong letter, split a flag into two regional letters, or break a family emoji into separate people. A careful reversal treats each user-perceived character, called a grapheme cluster, as one unit.
In JavaScript, the difference looks like this:
const text = "cafe\u0301 👍🏽";
// Splits into UTF-16 code units: can break emoji into invalid halves
text.split("").reverse().join("");
// Splits into code points: keeps emoji halves together,
// but still separates the accent and the skin-tone modifier
[...text].reverse().join("");
// Splits into grapheme clusters: keeps each visible character intact
const seg = new Intl.Segmenter(undefined, { granularity: "grapheme" });
[...seg.segment(text)].map(s => s.segment).reverse().join("");
If you are evaluating an existing tool, test it with an accented word typed in decomposed form, a flag emoji and an emoji with a skin-tone modifier. If any of these come out altered, the tool is reversing at a lower level than grapheme clusters.
Right-to-left scripts such as Arabic and Hebrew add another layer. Text in these scripts is stored in logical (reading) order and laid out right to left by the display system. Reversing the stored characters therefore produces text that displays left to right in reverse, and in Arabic it can also disturb letter joining. For mixed-direction text, check the result in the actual destination rather than assuming it will match the preview.
Limits that affect readability and reuse
The points below follow from how each method stores text. Behavior in specific apps, platforms and assistive technologies was not tested for this article, and no platform documentation was supplied. Treat any destination-specific outcome as something to confirm with your own test.
- Copy and paste: reversed and substituted text are ordinary characters, so they generally survive transfer. CSS effects do not travel with plain text. Bidirectional control characters may be kept, removed or ignored depending on the destination.
- Fonts: substitution styles depend on the destination having fonts that cover the borrowed characters. Where coverage is missing, readers may see empty boxes or fallback glyphs that break the effect.
- Screen readers: reversed text is announced as the characters actually stored, so listeners will hear it as backward letters or unpronounceable words. Substitution characters may be read as letters from another script, as symbol names, or skipped. How a particular screen reader handles them has not been verified here.
- Search and matching: reversed or substituted text will not match searches for the original words, and spell checkers will flag it.
- Bidirectional overrides: hidden direction controls have been used to disguise file names and code, so some platforms and security tools flag, strip or neutralize them. Do not rely on them for anything that must display consistently.
- Getting the original back: reversing plain text a second time restores it, provided the same grapheme-aware method is used both ways and the text was not changed in between. Substitution styles may not map back cleanly, so keep a copy of the original if you will need it again.
Sensitive text and external tools
Reversed text is not protection. Anyone can undo it in seconds, so it should not be used to hide passwords, personal details or confidential content. If you paste sensitive text into an online converter, it may be processed in your browser or sent to a server, and the difference can only be confirmed from that tool's own documentation or by observing its network activity. When that information is not available, use a local method instead, such as a short script like the one above run on your own machine.
When to use ordinary text instead
Backward and mirrored text suits puzzles, decorative headings, mirror-writing exercises and playful messages where readers expect the effect. Use normal forward text, or provide it alongside the styled version, when the content must be accessible, searchable or accurate. This includes names, instructions, contact details, legal or safety information, and anything a screen reader user needs to understand. If you only want a flipped look on a web page you control, CSS keeps the underlying text intact for copying, search and assistive technology. Verify the visual result in the browsers you support.