Inspect UTF-16 units used by JavaScript strings
JavaScript string length counts UTF-16 code units, not user-perceived characters. Paste text and choose Process input to see each unit's zero-based offset, decimal value and four-digit hexadecimal spelling. This is a code-unit report, not a UTF-16LE or UTF-16BE file encoder.
Example: a surrogate pair
The loaded Aé😀 example has four code units: 0041, 00E9, D83D and DE00. The last two together represent one emoji. They are displayed separately because the purpose is to inspect string storage, not to claim each surrogate half is a character. The source has three code points and four UTF-16 units.
Interpret units and offsets correctly
The offsets correspond to JavaScript indexing in the received text. Combining marks can occupy additional units even when a reader perceives one accented character. This page does not identify grapheme clusters, glyph widths or human language characters. Use Grapheme Cluster Viewer when that grouping is the question.
The hexadecimal values are numeric units without byte order. A file's endianness determines how a 16-bit unit becomes bytes, but no such serialization occurs here. Unpaired surrogate input is rejected so the tool's exports and linked Unicode workflows retain valid scalar text.
Preview, export and limits
The table previews the first 200 rows; the JSON download includes all rows with index, decimal and hex fields. It contains numeric representations rather than the source text. Input is limited to 50,000 UTF-16 code units, with a maximum report size of 20,000 bytes or code units. A shorter source is required when its encoded report exceeds that bound. Browser textareas may normalize pasted line endings before inspection. Processing remains local, and changing the input clears stale reports and download links.





