Encoding Tools
UTF-16 converter.
See text as UTF-16: the 16-bit code units, the surrogate pairs used for characters above U+FFFF, and the bytes in either byte order. Switch direction to decode UTF-16 hex, with or without a byte order mark.
Example: A😀 is code units 0041 D83D DE00. Big-endian bytes: 00 41 D8 3D DE 00. Little-endian bytes: 41 00 3D D8 00 DE. The emoji (U+1F600) takes a surrogate pair because it is above U+FFFF.
Inputs
Result
How UTF-16 works
UTF-16 stores each code point as one or two 16-bit code units. Code points below U+10000 take one unit holding the number itself (U+0041 is 0041). Larger code points take two: subtract 0x10000, giving a 20-bit number; the top 10 bits are added to 0xD800 (the high surrogate) and the low 10 bits to 0xDC00 (the low surrogate). For U+1F600 that gives 0xD83D and 0xDE00. That is the procedure in RFC 2781 section 2.1, and the reason U+D800 to U+DFFF are never assigned to characters.
Byte order. A code unit is two bytes, so the order matters. Big-endian puts the high byte first (D8 3D), little-endian the low byte first (3D D8). A byte order mark, the code point U+FEFF at the start, lets a reader tell them apart: FE FF means big-endian and FF FE means little-endian. RFC 2781 section 4.3 says that without a BOM, text labelled plain “UTF-16” should be read as big-endian. If you state the order yourself (UTF-16BE or UTF-16LE), a leading U+FEFF is not treated as a BOM, so this tool leaves it in the text in that case.
Where you meet it. JavaScript and Java strings, the Windows API and .NET all use UTF-16 code units, which is why "😀".length is 2 in JavaScript even though it is one character. The string byte length calculator compares all the lengths.
Invalid UTF-16. The decoder reports a high surrogate with no low surrogate after it, a low surrogate with no high before it, and an odd number of bytes (a unit needs two). Each bad unit appears as U+FFFD in the text.
Sources: RFC 2781, UTF-16 (sections 2.1, 4.3 and 5) and The Unicode Standard, chapter 3 (Conformance), retrieved October 2026.
Frequently asked questions
What is a surrogate pair?
Two UTF-16 code units, a high surrogate (D800 to DBFF) followed by a low surrogate (DC00 to DFFF), that together stand for one code point above U+FFFF. U+1F600 is D83D DE00.
What is the difference between UTF-16BE and UTF-16LE?
The byte order of each 16-bit unit. Big-endian writes the high byte first, little-endian the low byte first.
Do I need a BOM?
Only when the reader has to guess the byte order. If both sides already agree on UTF-16BE or UTF-16LE, no BOM is needed. For plain "UTF-16", RFC 2781 says to read as big-endian when there is no BOM.
Why is the JavaScript length of an emoji 2?
JavaScript counts UTF-16 code units, and an emoji above U+FFFF takes two of them. Use the code point count (for example Array.from(str).length) when you want characters.
Is UTF-16 the same as UCS-2?
No. UCS-2 is the older fixed 16-bit form that cannot represent code points above U+FFFF. UTF-16 adds surrogate pairs to reach all of Unicode.