#472 · Developer Tool

UTF-16 Code Unit Viewer

Lists every JavaScript UTF-16 code unit, its offset, hexadecimal value, and whether it is a high surrogate, low surrogate, or BMP unit. Everything runs locally in the current browser tab, so the input remains available for inspection and export without a server round trip.

Developer Input

Unicode text
Ad space

How to use this developer tool

  1. Paste or type the unicode text.
  2. Set any output option shown below the editor.
  3. Select View UTF-16 Units or press Ctrl/Cmd + Enter.
  4. Review the summary and copy or download the result.

What this developer tool does

Lists every JavaScript UTF-16 code unit, its offset, hexadecimal value, and whether it is a high surrogate, low surrogate, or BMP unit.

The implementation works from Unicode code points or byte arrays rather than assuming one character equals one byte. Invalid source notation is rejected before conversion.

Browser Unicode tables can change with browser releases; encoding formats themselves follow the rules described on this page.

Example

Input

A😀한

Run the included sample to see the exact output and byte statistics generated by your browser.

Use cases

  • Debug text exchanged between APIs and command-line tools.
  • Verify how multilingual strings are represented.
  • Prepare copy-ready values for fixtures and documentation.
  • Locate encoding mistakes before data is stored.

Tips for reliable output

  • Keep byte boundaries intact when pasting encoded input.
  • Compare byte counts, not only visible character counts.
  • Use the bundled sample to confirm the expected notation.
  • Download the output before editing a long result.
  • Test emoji and combining marks when international text matters.

Processing details

Processing uses TextEncoder, strict TextDecoder behavior, Unicode iteration, or the stated base alphabet as appropriate. The result statistics are calculated from the same byte array used to produce the displayed output.

This page treats decoded bytes as UTF-8 text. It is not a general binary-file decoder, and extremely large pasted values are limited by browser memory.

Frequently asked questions

What input does the UTF-16 Code Unit Viewer accept?

It accepts unicode text in the input area. The page validates the format before producing output.

Does the UTF-16 Code Unit Viewer send data to a server?

No. Processing runs in your browser, and the page does not need an API call.

How does this page handle emoji and non-Latin text?

It uses browser Unicode APIs and UTF-8 encoding rules, so emoji and multilingual text are processed as Unicode rather than ASCII.

Why can the character count differ from the byte count?

A visible character may contain several code points, and each code point can require multiple UTF-8 bytes.

Can I download the UTF-16 Code Unit Viewer result?

Yes. Run the conversion, then use Download to save the copy-ready text result.

Format reference

PropertyValue
Runs locallyYes
Text encodingUTF-8 / Unicode
External librariesNone

Encoding & Decoding tools

Browse byte, Unicode, and text encoding utilities in the category hub.

Open category hub