Surrogate Pair
Embed This Widget
Add the script tag and a data attribute to embed this widget.
Embed via iframe for maximum compatibility.
<iframe src="https://emojifyi.com/iframe/glossary/surrogate-pair/" width="420" height="400" frameborder="0" style="border:0;border-radius:10px;max-width:100%" loading="lazy"></iframe>
Paste this URL in WordPress, Medium, or any oEmbed-compatible platform.
https://emojifyi.com/glossary/surrogate-pair/
Add a dynamic SVG badge to your README or docs.
[](https://emojifyi.com/glossary/surrogate-pair/)
Use the native HTML custom element.
Two UTF-16 code units (a high surrogate U+D800-U+DBFF followed by a low surrogate U+DC00-U+DFFF) that together represent a character above U+FFFF.
Characters with code points above U+FFFF cannot fit in a single 16-bit value. UTF-16 solves this by encoding them as two 16-bit values called a surrogate pair. Since most emoji are above U+FFFF, surrogate pairs are extremely common with emoji.For example, 😀 (U+1F600) becomes the surrogate pair 0xD83D 0xDE00 in UTF-16. The formula: high surrogate = 0xD800 + ((cp - 0x10000) >> 10), low surrogate = 0xDC00 + ((cp - 0x10000) & 0x3FF).
This is why JavaScript's `'😀'.charCodeAt(0)` returns 55357 (0xD83D) — it's returning the high surrogate, not the actual code point.