Identify Unicode Variation Selectors
How to spot Unicode variation selectors, what they change in stored text and on screen, and when to keep or strip them in text transformation workflows.
A Unicode variation selector is an invisible character placed after another character to request a specific glyph form. It does not change which letter, symbol or ideograph the text contains. It changes how that character should be drawn when a font and renderer support the requested form. Because the selector cannot be seen, it often causes confusing results: two strings look identical but do not match, a character count is higher than expected, or reversed or mirrored text produces stray symbols. This review explains how to find variation selectors, what they do, and when keeping or removing them is the right choice.
Short answer: inspect freely, strip or keep deliberately
Inspecting text to find variation selectors is a read-only step and is safe to do in any workflow. The main benefit is clarity: a code point view shows exactly why two visually identical strings behave differently. The decision that matters comes after identification. Removing selectors makes text simpler to compare, search and store, but it can change how emoji and some CJK ideographs display. Keeping them preserves the intended appearance, but it adds invisible characters that some systems count, compare or handle inconsistently.
Plain text without variation selectors is usually preferable for identifiers, usernames, search keys, database lookups, deduplication and any data that is compared exactly. Keep selectors when the visual form carries meaning, such as an emoji that should appear in color rather than as a monochrome symbol, or a registered ideographic variant used in a personal or place name.
What a variation selector actually changes
A variation selector changes the stored text: it adds one code point after a base character. It does not change the base character, and it does not apply a font, style or CSS effect. The visible result depends entirely on whether the combination of base character plus selector is a defined sequence, and whether the font and rendering software support it. If the sequence is not defined, the Unicode Standard says the selector should have no visible effect.
Variation selectors belong to the general category of nonspacing marks and are classed as default ignorable code points. In practice, that means software is expected to render nothing for them on their own, even when it does not understand them.
| Range | Names | Typical use |
| U+FE00 to U+FE0D | VARIATION SELECTOR-1 to VARIATION SELECTOR-14 | Standardized variation sequences, for example certain mathematical symbols and CJK compatibility forms |
| U+FE0E | VARIATION SELECTOR-15 (text presentation selector) | Requests a text-style, usually monochrome, presentation of a symbol that can also appear as emoji |
| U+FE0F | VARIATION SELECTOR-16 (emoji presentation selector) | Requests emoji-style, usually color, presentation |
| U+E0100 to U+E01EF | VARIATION SELECTOR-17 to VARIATION SELECTOR-256 | Ideographic variation sequences registered in the Ideographic Variation Database |
| U+180B to U+180D and U+180F | MONGOLIAN FREE VARIATION SELECTOR ONE to FOUR | Selecting contextual glyph variants in Mongolian script |
The defined sequences are listed in data files published with the Unicode Character Database: standardized sequences in StandardizedVariants.txt, emoji sequences in emoji-variation-sequences.txt, and ideographic sequences in the Ideographic Variation Database. A selector attached to a character outside these lists is valid text but carries no defined meaning.
A common example
The heart symbol U+2764 HEAVY BLACK HEART may display as a plain text symbol. Followed by U+FE0F, it forms an emoji variation sequence that requests the color emoji heart. The two forms look different on many systems but share the same base character. A strict string comparison treats them as different strings, because one contains two code points and the other contains one.
Text heart: U+2764
Emoji heart: U+2764 U+FE0F
UTF-8 bytes:
U+2764 E2 9D A4
U+FE0F EF B8 8F
U+E0100 F3 A0 84 80
UTF-16 code units:
U+FE0F FE0F
U+E0100 DB40 DD00
Selectors also appear inside longer emoji sequences. A keycap digit, for example, is typically encoded as the digit, then U+FE0F, then U+20E3 COMBINING ENCLOSING KEYCAP. Removing the selector from such a sequence may change how it displays, depending on the platform.
Clearing up 'font', 'reverse' and 'mirror'
Variation selectors are sometimes described as a way to change a character's 'font'. That is misleading. They request an alternate glyph within whatever font is in use, and only for defined sequences. They are unrelated to the styled letters that online 'font generators' produce, which substitute different code points such as mathematical alphanumeric symbols.
Reversal tools interact badly with selectors. A selector applies to the character immediately before it. If a tool reverses text code point by code point, the selector moves in front of its base character, so it either attaches to the wrong character or is left with nothing to modify. The same problem affects combining accents and multi-code-point emoji. A reversal that preserves meaning has to treat each base character and its following selectors and marks as one unit, usually called a grapheme cluster. Mirrored-text effects that work by visual flipping, such as a CSS transform, do not reorder stored characters, so they leave selectors in place.
How to identify variation selectors
Since selectors are invisible, you need a view that shows code points or bytes. Useful search terms for finding a suitable tool include 'Unicode code point inspector', 'Unicode character viewer', 'show invisible characters' and 'hex dump'. Many code editors offer a setting to reveal invisible or control characters; check the documentation of the editor you use, because the setting name and default behavior vary. This review does not name specific online inspectors because none were verified for it.
Clues that a string may contain a variation selector:
- Two strings look identical but a comparison or search reports no match.
- A character counter reports one or more characters than you can see.
- A symbol displays in color in one place and in monochrome in another.
- The cursor needs an extra keypress to move past an emoji or ideograph.
- Reversed text shows a stray box or an unexpected emoji style next to a different character.
Programming languages can list code points directly. In Python, the standard unicodedata module returns the character name, which makes selectors easy to recognize:
import unicodedata
s = "\u2764\ufe0f"
for ch in s:
print(f"U+{ord(ch):04X}", unicodedata.name(ch, "<unnamed>"))
# Expected names:
# U+2764 HEAVY BLACK HEART
# U+FE0F VARIATION SELECTOR-16
In JavaScript, iterating a string with for...of yields whole code points, so supplementary selectors in the U+E0100 range are reported as a single value rather than two surrogate halves:
const s = "\u2764\uFE0F";
for (const ch of s) {
const cp = ch.codePointAt(0).toString(16).toUpperCase().padStart(4, "0");
console.log("U+" + cp);
}
To detect or remove selectors in bulk, a regular expression covering the ranges in the table above is enough. Remember that the Mongolian free variation selectors sit in a separate range and are easy to forget.
# Python
import re
VS = re.compile("[\u180b-\u180d\u180f\ufe00-\ufe0f\U000e0100-\U000e01ef]")
has_vs = bool(VS.search(text))
stripped = VS.sub("", text)
// JavaScript (the u flag is required for the supplementary range)
const VS = /[\u180B-\u180D\u180F\uFE00-\uFE0F\u{E0100}-\u{E01EF}]/gu;
const stripped = text.replace(VS, "");
On the command line, a byte dump shows selectors as their UTF-8 sequences. For U+FE00 to U+FE0F, look for EF B8 followed by a byte from 80 to 8F. For VS17 and above, look for four-byte sequences beginning F3 A0 84 to F3 A0 87.
Will the text stay usable after copying or sharing?
A standard copy and paste copies the selector along with the visible character, because it is part of the stored text. What happens next depends on the destination, and no destination-specific behavior was tested for this review. Some input methods, keyboards and platforms add the emoji selector automatically, while some sanitizers or form filters remove invisible characters. Treat the presence or absence of selectors in pasted text as something to check rather than assume.
Unicode normalization does not help here. The NFC, NFD, NFKC and NFKD forms leave variation selectors in place, so normalizing two strings will not make the text heart and the emoji heart compare as equal. If your workflow needs them to match, strip selectors explicitly as a separate step, and do it only for comparison or indexing if you still need the original for display.
Search and editing can also be affected. A search for a symbol without the selector may or may not find text that contains it, depending on whether the search engine or application ignores default ignorable characters. Length limits may count selectors as characters, bytes or UTF-16 units, so a field that accepts one form can reject another.
For accessibility, selectors are designed to be ignored rather than spoken, and screen readers generally announce the base character or emoji description. This review has no documentation or test results for particular assistive technologies, so it cannot confirm how any specific screen reader handles a given sequence. Where an emoji or symbol carries meaning, such as a status or warning, a plain-text label alongside it is the more reliable choice.
Invisible characters can also be misused. Long runs of supplementary variation selectors have been used to hide data inside text that appears to contain a single emoji. If you process untrusted input, inspecting for unexpected selectors, especially many in a row or selectors attached to ordinary letters, is a reasonable validation step.
Choosing what to do with selectors you find
- Keep them when the presentation is intentional: emoji that should render in color, text-style symbols that should stay monochrome, or registered ideographic variants that matter for names.
- Strip them for matching keys, usernames, identifiers, deduplication and search indexes, ideally while keeping the original string for display.
- Remove or reject them when they follow characters with no defined sequence, or appear in unusual quantities, since they add nothing visible and may indicate hidden content.
- Preserve them as a unit with their base character in any reversal, truncation or splitting step, so that no selector ends up detached.
Gaps in this review
The descriptions of ranges, character properties, normalization behavior and byte encodings follow the Unicode Standard and general, verifiable encoding rules. The review does not include tests of specific apps, websites, operating systems or screen readers, and it does not name or evaluate particular online inspection tools. Before relying on a destination to preserve or display a sequence, test it in that specific environment with the code point view described above.