GPT-4 Tokenizer: How Reversed, Mirrored and Unicode-Styled Text Is Tokenized
How the GPT-4 tokenizer handles reversed text, mirrored glyphs, Unicode "fonts" and bidirectional controls, and when plain text is the better choice for prompts and sharing.
Text transformations such as reversed strings, upside-down letters, bold or script "fonts" made from Unicode symbols, and right-to-left display tricks can look harmless on screen. A language model does not read the screen, though. It reads tokens. This review explains what the GPT-4 tokenizer receives when you feed it transformed text, what each transformation actually changes, and when plain text is the safer option.
Short answer: is a transformation suitable for GPT-4 input?
For prompts, instructions and any text you want the model to understand, plain text is the better default. Most decorative transformations replace common characters with rarer ones or reorder them, which tends to break text into more, smaller tokens and moves it away from the ordinary patterns the model handles most reliably. The main benefit of a transformation is visual: it can make a social post, username or heading stand out to human readers. The decisive tradeoff is that the stored characters change, so token usage, searchability, editing and assistive-technology support can all suffer.
Transformations are reasonable when the output is meant for display only, when you keep a plain-text version alongside it, or when you are deliberately testing how a tokenizer or model responds to unusual input. Prefer plain text when the content will be sent to an API with token limits or costs, processed by other software, searched, quoted, edited later, or read with a screen reader.
How the GPT-4 tokenizer works in brief
GPT-4 uses a byte-level byte pair encoding (BPE) tokenizer. In OpenAI's open-source tiktoken library, the encoding associated with GPT-4 and GPT-4 Turbo is named cl100k_base; later models such as GPT-4o use a different encoding (o200k_base), so counts for the same text can differ between model families. Text is first converted to UTF-8 bytes, then frequently occurring byte sequences are merged into single tokens according to a learned vocabulary.
Two consequences matter for transformed text. First, any string can be encoded, because unknown characters fall back to their raw bytes. Second, sequences that were common in the tokenizer's training data, such as ordinary English words, tend to become a single token or a few tokens, while rare characters and unusual orderings tend to be split into more pieces. No measured token counts were supplied for this review; the reliable way to check a specific string is to run it through a tokenizer for the exact model you plan to use.
What each transformation actually changes
The words "reverse", "mirror" and "font" are used loosely by text tools. The key question for tokenization is whether the stored characters change or only their on-screen presentation. The tokenizer sees stored characters and nothing else.
| Transformation | What is stored | What the GPT-4 tokenizer sees |
| Character reversal ("hello" to "olleh") | Same characters in reverse order | A reordered string that rarely matches common token merges |
| Word reversal ("one two three" to "three two one") | Same words in a different order | Ordinary word tokens, but in a changed sequence that can change meaning |
| Upside-down or mirrored glyph substitution ("hello" to "oสสวษฅ") | Different Unicode characters chosen for their shape | Unrelated characters, often from IPA or other blocks, split into byte-level pieces |
| Unicode "fonts" (mathematical bold, script, double-struck, fullwidth) | Different code points that resemble styled Latin letters | Characters outside basic Latin, each taking several UTF-8 bytes |
| CSS or app formatting (bold, italic, transform: scaleX(-1)) | The original characters, unchanged | The original text; the visual styling is not part of the string |
| Bidirectional controls (for example U+202E RIGHT-TO-LEFT OVERRIDE) | The original characters in logical order plus invisible control characters | The original text plus extra control characters, not the reversed order shown on screen |
Unicode "font" generators are the most common source of confusion. A letter like ๐ (MATHEMATICAL BOLD CAPITAL A, U+1D400) is not the letter A with bold styling; it is a separate character from a supplementary Unicode block, encoded as four bytes in UTF-8 instead of one. Because these characters are rare in ordinary text, a word written in them is likely to tokenize into many more pieces than the same word in plain letters. By contrast, bold applied through HTML, CSS or a rich-text editor leaves the characters untouched, and copying it as plain text gives the tokenizer normal letters.
Bidirectional display tricks work the other way around. A right-to-left override can make text appear reversed in a browser or chat window while the stored characters remain in their original order. The tokenizer receives that logical order plus the invisible control character, so the model may see something quite different from what a person sees on screen.
Reversal pitfalls: combining marks and emoji
Naive reversal tools reverse code points rather than user-perceived characters. That breaks text that relies on sequences of code points to form a single visible character. The examples below show the intended input and what a code-point reversal produces; they describe the mechanism and are not results from a specific tool.
Input (decomposed): cafeฬ c a f e + U+0301 COMBINING ACUTE ACCENT
Code-point reversal: ฬefac accent now precedes the e and attaches to nothing
Grapheme reversal: รฉfac e and its accent kept together
Input: ๐ฉโ๐ฉโ๐ง woman + ZWJ + woman + ZWJ + girl
Code-point reversal: ๐งโ๐ฉโ๐ฉ a different sequence, or separate emoji if unsupported
Grapheme reversal: ๐ฉโ๐ฉโ๐ง the cluster is kept as one unit
For tokenization, a broken sequence means the model receives stray combining marks, orphaned zero-width joiners or reordered emoji components. These add tokens and can make the text ambiguous. If you need reversed text, use a tool that reverses by grapheme cluster, and be aware that even correct grapheme reversal produces a string the model will not read as the original words.
Effect on how the model interprets the text
GPT-4 can often recognize simple transformations, and it may decode reversed or styled text when asked. That recognition is not guaranteed, and no test results for specific strings or tasks were supplied for this review. As a general principle, text that tokenizes into unusual fragments gives the model less familiar input, so instructions written in decorative characters or reversed order are a poor choice when accuracy matters. If you rely on the model to follow instructions, extract facts or count characters, give it plain text.
Token counts also affect practical limits. Context windows and API billing are measured in tokens, so a transformation that multiplies the token count of a passage reduces how much content fits in a request and can raise cost. The size of that effect depends on the specific characters and model encoding and should be measured rather than assumed.
Will the result stay readable and usable after copying or sharing?
Copying preserves stored characters, not presentation. Text styled with CSS or rich-text formatting usually loses that styling when pasted into a plain-text field, which is often what you want for a prompt. Unicode "font" characters, upside-down substitutions and bidirectional control characters travel with the text, so they reach the tokenizer, search indexes and other applications intact.
- Search: substituted characters generally do not match plain-text queries. Unicode NFKC normalization maps many mathematical alphanumeric characters back to ordinary letters, but upside-down substitutes such as ว or ษ have no such mapping, and you cannot assume a given search system applies normalization at all.
- Editing: reversed or substituted text is hard to correct, spell-check or translate, and hidden bidirectional controls can make cursor movement and selection behave unexpectedly.
- Rendering: some devices and fonts lack glyphs for less common characters and show empty boxes or fallback symbols. A string that displays correctly on one device is not evidence that it displays correctly everywhere.
- Assistive technology: screen readers may announce styled Unicode letters by their character names, spell them out, or skip them, depending on the reader, its settings and the platform. No documentation or scoped test for a specific screen reader was supplied, so this behavior should be checked in the target environment rather than assumed.
- Reading order: bidirectional overrides make displayed order differ from stored order, which can confuse both people who copy the text and software that processes it, including the tokenizer.
Provide a plain-text equivalent whenever transformed text carries meaning someone needs: names, instructions, links described in words, prices, warnings or anything that must be searchable or accessible. For model input, send the plain version and treat the styled version as display-only.
Practical checklist before sending transformed text to GPT-4
- Decide whether the model needs to understand the text or only pass it through; if it must understand it, use plain text.
- Check whether the transformation changes stored characters or only presentation; only stored changes affect tokenization.
- Count tokens with a tokenizer that matches the exact model, since GPT-4 and newer models use different encodings.
- For reversed text, confirm the tool keeps combining marks and emoji sequences intact.
- Look for invisible characters such as bidirectional overrides and zero-width joiners before pasting into a prompt.
- Keep a plain-text copy for search, accessibility and later editing.
Known gaps in this review
This review is based on documented Unicode behavior and the general design of byte-level BPE tokenizers. It does not include measured token counts for specific transformed strings, tested comparisons of model accuracy on transformed versus plain input, or verified screen reader behavior for particular products. Readers with a specific workflow should test their actual strings with the target model's tokenizer and their actual destination platforms before relying on a transformation.