UTF-16 to text decoder

Paste units such as 0633 or \uD83D\uDE00 to read the text, or choose BE or LE for bytes from a file.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter utf-16 units and format.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

A unit outside D800 to DFFF is a character by itself. A pair (H, L) gives cp = 10000 + (H − D800) × 400 + (L − DC00), in hex.

Example

Inputs: Format = Code units (0633). Result: Decoded text: 😀; Characters: 1; Code units: 2.

Limits and caveats

  • In code unit mode a joined string is split every 4 digits.
  • A leading BOM is kept as the character U+FEFF, not removed.

Questions about this tool

Why is D83D on its own rejected?

It is a high surrogate and needs a low unit from DC00 to DFFF after it to form a character.

How do I know if bytes are BE or LE?

A file starting with FE FF is BE and one starting with FF FE is LE. English text in LE shows 00 after each letter.

Does it accept \u escapes from JSON and Java?

Yes. \u is removed and every 4 digits are read as one unit.