Unicode variation selectors are invisible characters that can change whether a symbol is displayed in a text or emoji style. This guide explains VS15 and VS16, shows how to inspect their code points and bytes, and provides a practical checklist for diagnosing rendering, search, storage, and copy-and-paste problems.
Overview
Some Unicode characters have more than one conventional presentation. A telephone symbol, airplane, heart, or pencil may appear as a simple monochrome text glyph in one context and as a colorful emoji in another. The visible difference is not necessarily caused by a different base character. Often, the text contains the same base character followed by an invisible variation selector.
The two selectors most relevant to text and emoji presentation are:
| Name | Code point | Escape | Typical purpose |
|---|---|---|---|
| Variation Selector-15 (VS15) | U+FE0E | \uFE0E | Requests text-style presentation |
| Variation Selector-16 (VS16) | U+FE0F | \uFE0F | Requests emoji-style presentation |
For example, U+2764 is the black heart suit character. The sequence U+2764 U+FE0E requests text presentation: ♥︎. The sequence U+2764 U+FE0F requests emoji presentation: ❤️. The selector is not visible by itself, but it is part of the string and can affect equality checks, search, storage, and layout.
Variation selectors are different from combining marks and from zero-width joiners, although all can participate in a user-perceived character sequence. A variation selector usually follows the character whose presentation it modifies. It does not create a new independent letter or symbol for users to read, and it should not be counted as a visible character in product interfaces.
Reference examples and byte inspection
The following examples show common base-character and selector combinations. The exact appearance depends on the operating system, browser, font, application, and whether the sequence is supported.
| Intent | Sequence | Code points |
|---|---|---|
| Text telephone | ☎︎ | U+260E U+FE0E |
| Emoji telephone | ☎️ | U+260E U+FE0F |
| Text airplane | ✈︎ | U+2708 U+FE0E |
| Emoji airplane | ✈️ | U+2708 U+FE0F |
| Text heart | ♥︎ | U+2665 U+FE0E |
| Emoji heart | ♥️ | U+2665 U+FE0F |
In UTF-8, the base heart U+2764 is encoded as E2 9D A4. VS16, U+FE0F, is encoded as EF B8 8F. Therefore, the emoji-style sequence U+2764 U+FE0F has the byte sequence E2 9D A4 EF B8 8F. If an application stores only E2 9D A4, it has removed the presentation selector, even though the visible result may look acceptable in one environment.
For a quick JavaScript inspection, use code points rather than relying only on what the console displays:
const value = "❤️";
console.log([...value].map(char =>
"U+" + char.codePointAt(0).toString(16).toUpperCase()
));
// ["U+2764", "U+FE0F"]
console.log([...value].length); // 2 code points
console.log(value.length); // 2 UTF-16 code units here
For more complicated emoji, such as sequences using skin-tone modifiers or zero-width joiners, code-point counts still do not equal the number of user-perceived characters. Use grapheme-cluster-aware processing when truncating, validating, or measuring text. The related guide on emoji, grapheme clusters, and Unicode-aware string length covers that distinction in more detail.
Checklist by scenario
When a symbol changes from monochrome to colorful
- Copy the exact value into a code-point inspector instead of retyping it.
- Check whether the base character is followed by
U+FE0EorU+FE0F. - Compare the result in the same browser, operating system, font stack, and application where the problem occurs.
- Inspect CSS and font loading. A missing emoji-capable font or a different fallback font can change the appearance even when the string is correct.
- Decide whether your product needs a requested presentation or only a consistent semantic symbol. Do not remove selectors as a visual fix without testing search and data behavior.
When equality or search does not match
- Compare the strings by code point, not by appearance.
- Check for VS15, VS16, zero-width joiners, skin-tone modifiers, and invisible characters around the apparent symbol.
- Define the intended matching rule. Exact matching should preserve the full sequence; presentation-insensitive matching may intentionally remove or standardize variation selectors.
- Apply the same policy at indexing and query time. Normalizing only one side creates inconsistent results.
- Keep the original value if the presentation choice may matter for display, export, or audit history.
When data is lost during APIs, databases, or messaging
- Capture the input before serialization and after deserialization.
- Inspect the JSON representation. A selector may appear as the literal character or as an escape such as
\uFE0F; both can represent the same code point. - Verify that every layer handles Unicode text as Unicode rather than converting through a narrow legacy encoding.
- Check truncation, sanitization, slug generation, and filtering functions for code-point or grapheme-unsafe behavior.
- Test copy-and-paste through the actual channel, because messaging clients and rich-text editors may rewrite sequences.
What to double-check
Base character versus complete sequence: ♥, ♥︎, and ♥️ are not necessarily identical strings. The latter two include a selector, and the requested presentation differs.
Encoding versus rendering: Correct UTF-8 storage does not guarantee a colorful glyph. Rendering is also influenced by fonts and platform support. Conversely, a colorful appearance does not prove that VS16 is present; a character may have an emoji-style default in a particular environment.
Normalization: NFC, NFD, NFKC, and NFKD address canonical or compatibility composition. They are not a general-purpose “make every emoji look the same” operation. Test your chosen normalization library with representative sequences, and preserve selectors when presentation is part of the requirement. See the Unicode normalization guide for the broader rules.
String length: JavaScript’s length property counts UTF-16 code units, not visible characters. A variation selector can therefore affect length checks even though it adds no visible mark. Use a grapheme-aware library or API for user-facing limits.
HTML and CSS: HTML character references such as ❤️ can make a sequence explicit. CSS can influence the selected font, but it cannot reliably replace a missing or altered Unicode sequence. Keep content data and presentation styling separate while testing both.
Common mistakes
- Comparing screenshots instead of strings. Two values can look alike while differing by VS15, VS16, or another invisible character.
- Stripping every non-ASCII character. This can remove meaningful Unicode data, including selectors and the symbols they modify.
- Using normalization as a universal cleanup step. Normalization does not define your application’s presentation-insensitive matching policy.
- Splitting a string by code unit. This can separate Unicode sequences and produce broken output. Treat emoji and other extended grapheme clusters as units when editing or truncating.
- Assuming a missing color glyph means corrupted data. First inspect the code points, then test fonts and platform rendering.
- Removing VS16 to make a layout fit. This may change appearance, search behavior, or downstream exports. Fix the layout constraint separately where possible.
When to revisit
Revisit this checklist before seasonal or campaign content is prepared, especially when users will copy symbols between websites, chat systems, spreadsheets, and design tools. It is also worth returning to the checklist whenever you change a database driver, JSON serializer, search index, text editor, font stack, sanitization rule, or Unicode-processing library.
For a repeatable debugging pass, save a small fixture containing text-style and emoji-style pairs such as ✈︎ and ✈️. Record their code points and UTF-8 bytes, then run the fixture through input validation, storage, API serialization, search indexing, rendering, and export. Compare the original and final sequences rather than relying only on screenshots.
If the issue extends beyond presentation—such as URL handling, right-to-left layout, confusable identifiers, or general encoding failures—continue with the relevant references on code points and UTF-8/UTF-16, web-app encoding errors, and Unicode security and confusables. The key practice remains the same: preserve the original Unicode sequence, inspect it at each boundary, and make any presentation or matching policy explicit.