UTF-16 Encoding Table

Enter short text to view each character’s UTF-16 code units, BE/LE bytes, and BMP or surrogate-pair type, while retaining a quick reference to the surrogate ranges.

Local browser processing
This page has passed the public directory check; full functionality is available after enabling JavaScript.
User Guide

How to use the UTF-16 encoding table

UTF-16 code units and byte-order results are calculated only in the current browser; the text is not uploaded.

  1. Enter short text

    Enter at most 64 Unicode scalar values; the tool processes each character in the original order.

  2. View code units

    View one BMP code unit or a high- and low-surrogate pair character by character, along with the corresponding UTF-16BE and UTF-16LE bytes.

  3. Check surrogate ranges

    A single-character lookup links to BMP or surrogate-pair rules; you can copy TSV or clear the input.

Limitations and Notes

  • The byte column displays only the code unit bytes in the specified byte order; it does not automatically add BOM or infer the file’s byte order.
  • Supplementary-plane scalar values use two 16-bit code units; the number of code units cannot be directly treated as the number of user-visible characters.
  • An isolated high or low surrogate is not a valid Unicode scalar value; the tool fails closed instead of generating replacement bytes.

FAQ

Why does an Emoji have two UTF-16 code units?

Supplementary Plane scalar values above U+10000 require one high surrogate and one low surrogate to be represented together.

Why do UTF-16BE and UTF-16LE have opposite byte orders?

Both represent the same 16-bit code unit; only the storage order of the high and low bytes in each code unit differs.

Will the page output include BOM?

No. This displays the encoding bytes for a single scalar; whether a file requires BOM depends on the specific format and protocol.

Page feedbackFound an issue or have suggestions for improvement?
Feedback features need to be used in the online version

Please enable JavaScript in the online version before submitting; local features of the current tool or example are not affected.

Go to the online version for feedback