Understanding the mirror text generator — concept and principle
Mirror text reads correctly when held up to a mirror. This generator reverses each line and swaps every character for a mirror-image look-alike where Unicode has one, such as b ↔ d, p ↔ q and reversed letters like ɘ and Ǝ. Letters with no mirrored form stay as they are, so the result is a close approximation of a true reflection.
How it is calculated
For each line (line order stays the same):
- Reverse the order of characters
- Replace each character with its mirror form if one exists: symmetric letters (A, H, I, M, O, T, U, V, W, X, Y, i, l, o, v, w, x) stay; b ↔ d, p ↔ q; brackets and slashes swap direction; Unicode "REVERSED" letters replace a, c, e, r, C, E, F, L, P and ?
- Letters with no mirrored form (such as B, D, G, K, N, R, S, Z, f, g, h, k, s) stay as typed
Counts: characters swapped, letters and digits left without a mirror form, UTF-16 length
The principle
A mirror reverses left and right. Reversing the order of characters handles the whole line, and replacing each character with its mirror image handles each letter's shape. Symmetric letters look the same in a mirror, some letters are mirror images of each other, and Unicode includes a set of "reversed" letters from historical, phonetic and epigraphic use. For letters Unicode never encoded in reversed form, the original shape must remain, which is why the reflection is not perfect.
Worked example
Default input: "Happy birthday, Mom!" and "TOMATO" on two lines.
- Line 1 reversed: "!moM ,yadhtrib yppaH".
- Swapping a → ɒ, p → q, r → ɿ, b ↔ d gives !moM ,yɒbhtɿid yqqɒH.
- Line 2: "TOMATO" reversed is "OTAMOT", and every letter is symmetric: OTAMOT.
- Characters swapped for a mirror form = 7; letters with no mirror form = 4.
- UTF-16 length of the result = 27.
How to read the result
Hold the result up to a mirror or flip it horizontally to check. Text made of symmetric letters, like TOMATO, mirrors perfectly; text with many asymmetric letters will contain some that look unchanged. The effect is best for short words and decorative uses such as signs for a mirror selfie or puzzles.
Common mistakes
- Expecting a perfect reflection for every letter.
- Confusing mirror text (left–right) with upside-down text.
- Reversing the line order as well as each line.
- Using it where text must be searchable or accessible.
Frequently asked questions
Why do some letters stay the same?
Either they are symmetric, or Unicode has no reversed version of them.
Is mirror text the same as upside-down text?
No. Mirror text flips left to right; upside-down text rotates 180°.
Why is the line order unchanged?
A vertical mirror reverses left and right, not top and bottom.
How can I check the result?
Read it in a real mirror or flip a screenshot horizontally.
Sources: The Unicode Standard 15.1, Unicode Character Database names for the "REVERSED" letters (U+018E, U+0258, U+027F, U+2183, U+2184, U+2143, U+A7FB, U+A7FC) and U+2E2E REVERSED QUESTION MARK · Unicode Standard Annex #9, BidiMirroring.txt (bracket pairs)