UTF-16 Encoder Decoder
Encode Unicode text into UTF-16LE or UTF-16BE hexadecimal, decimal or binary bytes, or decode UTF-16 byte sequences back into readable text. Inspect UTF-16 code units, byte order, BOM values, surrogate pairs and Unicode code points with strict validation.
—
—
—
UTF-16 Encoder Decoder
The UTF-16 Encoder Decoder converts Unicode text into UTF-16 byte sequences and converts UTF-16 bytes back into Unicode text. It supports both UTF-16 little-endian and UTF-16 big-endian byte order so you can inspect how the same 16-bit code unit is stored in different systems.
You can display UTF-16 data as hexadecimal bytes, decimal byte values or eight-bit binary groups. The converter also shows Unicode code points, UTF-16 code units, byte counts, surrogate pairs and Byte Order Mark information.
This makes the tool useful for software development, file-format analysis, protocol debugging, reverse engineering, Unicode education, database troubleshooting and inspecting encoded binary data.
How to Encode Text to UTF-16
Select Encode Text → UTF-16, choose little-endian or big-endian byte order and enter the Unicode text you want to convert. You may also choose whether a UTF-16 Byte Order Mark should be added.
The converter processes each Unicode code point and creates the appropriate UTF-16 code unit or surrogate pair before arranging the bytes according to the selected byte order.
Text:
ABC
UTF-16LE:
41 00 42 00 43 00
UTF-16BE:
00 41 00 42 00 43How to Decode UTF-16 Bytes
Select Decode UTF-16 → Text, choose the input byte format and specify the expected byte order. Hexadecimal UTF-16 data may be entered as separated bytes such as 41 00 AC 20 or as a continuous hexadecimal sequence.
UTF-16LE bytes:
AC 20
Decoded character:
€
Unicode:
U+20ACWhen BOM detection is selected, the decoder checks the beginning of the byte stream for FF FE or FE FF and uses that marker to determine the correct endianness.
UTF-16LE vs UTF-16BE
UTF-16 stores data in 16-bit code units, but those 16 bits are physically stored as two eight-bit bytes. Little-endian and big-endian systems place those bytes in opposite orders.
| Character | Code Unit | UTF-16LE | UTF-16BE |
|---|---|---|---|
| A | 0041 | 41 00 | 00 41 |
| € | 20AC | AC 20 | 20 AC |
| 中 | 4E2D | 2D 4E | 4E 2D |
Changing byte order does not change the Unicode character itself. It only changes the sequence in which the two bytes of each 16-bit code unit are stored.
UTF-16 Byte Order Mark
A Byte Order Mark, commonly abbreviated BOM, may appear at the beginning of UTF-16 data to indicate byte order. The Unicode value used for the marker is U+FEFF.
UTF-16LE BOM:
FF FE
UTF-16BE BOM:
FE FFWhen a UTF-16 decoder sees FF FE at the beginning of a byte stream, it can interpret the following data as little-endian. FE FF indicates big-endian storage.
Not every UTF-16 data source includes a BOM, so applications may also need to know the byte order from external metadata or protocol rules.
UTF-16 Code Units Explained
UTF-16 represents Unicode using 16-bit code units. Most Unicode code points between U+0000 and U+FFFF can be represented by a single code unit. The surrogate range U+D800 through U+DFFF is reserved for representing supplementary Unicode characters.
Character:
€
Unicode code point:
U+20AC
UTF-16 code unit:
20AC
Code units:
1
Bytes:
2UTF-16 Surrogate Pairs
Unicode characters above U+FFFF cannot fit directly into one 16-bit UTF-16 code unit. UTF-16 represents these supplementary code points using two code units called a surrogate pair.
The first value is a high surrogate in the range D800–DBFF. The second is a low surrogate in the range DC00–DFFF.
Character:
😀
Unicode:
U+1F600
UTF-16 code units:
D83D DE00
UTF-16LE bytes:
3D D8 00 DE
UTF-16BE bytes:
D8 3D DE 00
Code units:
2
Bytes:
4UTF-16 Encoding Example for the Euro Sign
The euro sign has Unicode code point U+20AC. Since U+20AC is inside the Basic Multilingual Plane and outside the surrogate range, it needs only one UTF-16 code unit.
Character:
€
Code point:
U+20AC
UTF-16 code unit:
20AC
UTF-16LE:
AC 20
UTF-16BE:
20 AC
Decimal UTF-16LE:
172 32
Binary UTF-16LE:
10101100 00100000UTF-16 Encoding Example for Emoji
The grinning face emoji has code point U+1F600, which is above U+FFFF. It therefore requires a UTF-16 surrogate pair rather than a single 16-bit code unit.
Character:
😀
Unicode:
U+1F600
High surrogate:
D83D
Low surrogate:
DE00
UTF-16LE:
3D D8 00 DE
UTF-16BE:
D8 3D DE 00UTF-16 vs UTF-8
UTF-8 and UTF-16 can represent the same Unicode code points but use different storage strategies. UTF-8 uses one to four eight-bit bytes per code point, while UTF-16 uses one or two 16-bit code units.
| Character | Unicode | UTF-8 | UTF-16 Units |
|---|---|---|---|
| A | U+0041 | 41 | 0041 |
| € | U+20AC | E2 82 AC | 20AC |
| 😀 | U+1F600 | F0 9F 98 80 | D83D DE00 |
Neither UTF-8 nor UTF-16 changes the underlying Unicode identity of a character. They are different methods for representing that code point in stored or transmitted data.
UTF-16 vs Unicode Code Points
A Unicode code point identifies an abstract character, while a UTF-16 code unit is part of one particular encoding representation. This difference becomes particularly important for supplementary characters.
😀
Unicode code point:
U+1F600
UTF-16:
D83D DE00
One Unicode code point
Two UTF-16 code unitsIt is therefore incorrect to assume that every Unicode character always corresponds to exactly one UTF-16 code unit.
Character Count, Code Point Count and UTF-16 Length
Text length can be measured in several different ways. A string may be described by its visual characters, Unicode code points, UTF-16 code units or encoded bytes. These counts can differ.
Text:
A😀
Unicode code points:
2
UTF-16 code units:
3
UTF-16 bytes:
6
A:
1 code unit
😀:
2 code unitsThis difference is especially important in programming environments that expose string length in UTF-16 code units.
Common Uses for a UTF-16 Encoder Decoder
UTF-16 conversion is useful when inspecting Windows-oriented text data, binary file formats, network protocols, application memory, database values and APIs that expose UTF-16 code units.
Developers may also use the converter to troubleshoot endianness problems, verify BOM values, study surrogate pairs, compare UTF-8 and UTF-16 representations or inspect hexadecimal dumps containing Unicode text.
Typical technical uses
Typical scenarios include reverse engineering binary structures, checking UTF-16LE strings, decoding UTF-16BE payloads, debugging interoperability between systems, validating supplementary-plane characters and teaching how Unicode surrogate pairs operate.
Common UTF-16 Encoding Mistakes
A common mistake is forgetting that UTF-16 has a byte-order requirement. The code unit 20AC can appear as AC 20 in little-endian form or 20 AC in big-endian form.
Another mistake is assuming that every character occupies exactly two bytes. Characters above U+FFFF require a surrogate pair and therefore occupy four UTF-16 bytes.
It is also important not to interpret isolated surrogate code units as ordinary Unicode characters. A high surrogate must be followed by a valid low surrogate, and a low surrogate must belong to a corresponding high surrogate.
UTF-16 Encoder Decoder Limitations and Notes
The converter works with Unicode code points and UTF-16 code units. Some visual symbols can consist of multiple Unicode code points, such as emoji sequences containing variation selectors, skin-tone modifiers or zero-width joiners.
The tool does not perform Unicode normalization. Text is encoded according to the exact Unicode code points supplied, which is useful when comparing raw encoded representations.
When decoding data without a BOM, you must specify the correct endian order. Choosing the wrong order can produce unrelated Unicode code points or invalid surrogate sequences.