UTF-8 to UTF-16
Convert UTF-8 text to UTF-16 code units with surrogate pair support.
Paste text with emojis or rare characters and see the actual UTF-16 code units JavaScript uses under the hood. Anything above U+FFFF splits into a surrogate pair — which is why "🌍".length returns 2, not 1. And everything runs in your browser. Nothing gets uploaded.
How It Works
Each character is converted to its UTF-16 representation. BMP characters (U+0000–U+FFFF) use a single 16-bit code unit. Characters above U+FFFF are encoded as surrogate pairs: a high surrogate (D800–DBFF) followed by a low surrogate (DC00–DFFF), using the formula: high = 0xD800 + ((cp - 0x10000) >> 10), low = 0xDC00 + ((cp - 0x10000) & 0x3FF).