Skip to content
Hex Calculator

UTF-16 to Hex Converter

Encode text as UTF-16 bytes in hex (big-endian, 2 bytes per code unit) — the format JavaScript strings use internally.

UTF-16 hex result
0x004800690021

How to Convert Text to UTF-16 Hex

Every character becomes one 16-bit code unit (2 bytes) — or, for characters above U+FFFF like most emoji, a pair of code units (4 bytes total). Each unit is written as 4 hex digits, most significant byte first, concatenated in order.

Common Mistakes When Converting Text to UTF-16 Hex

  • Expecting the same byte count as UTF-8 — UTF-16 is wider for plain ASCII text.
  • Forgetting emoji and other high code points need a 4-byte surrogate pair, not 2 bytes.
  • Assuming byte order matches little-endian systems without checking — this output is big-endian.

Frequently Asked Questions

How do you convert text to UTF-16 hex?

Each character becomes one or two 16-bit code units (2 bytes each) — most characters need one, characters above U+FFFF like emoji need a surrogate pair of two — written as hex, most significant byte first.

Why does this output more hex digits than UTF-8 for the same text?

UTF-16's baseline is 2 bytes per code unit even for plain ASCII characters, while UTF-8 uses just 1 byte for those same characters — English text roughly doubles in size going from UTF-8 to UTF-16.

What does this converter use for emoji?

A surrogate pair — two 2-byte code units (4 bytes total) that together represent the one character, following the same rule JavaScript uses internally for strings containing emoji.

Is the output big-endian or little-endian?

Big-endian — each code unit's high byte comes first. Some systems (notably Windows internals) use little-endian UTF-16 instead; swap each byte pair if you need that format.

Why would I need UTF-16 hex specifically?

Debugging raw string data from JavaScript, Java, or Windows APIs, all of which use UTF-16 internally — seeing the exact bytes helps track down encoding mismatches.

Is this the reverse of Hex to UTF-16?

Yes — that page decodes UTF-16 hex bytes back into readable text.