Skip to content

Text to Binary / Hex

Converts text to and from binary, octal, decimal or hexadecimal in a chosen encoding.

Converts text to binary, octal, decimal or hex — and back — with the encoding as a control rather than an assumption. "The binary of 한" has four right answers: ED 95 9C in UTF-8, D5 5C in UTF-16, B0 A1 in CP949, and D55C as a code point.

🔒 Runs entirely in your browserbinaryhexencodeconvert

Direction

Convert

The default everywhere. Korean is three bytes per syllable.

Base

Text

Numbers

bytes

9

characters in

5

bytes per character

1.8

“The binary of 한” has four right answers: ED 95 9C in UTF-8, D5 5C in UTF-16, B0 A1 in CP949, and D55C as a code point. Picking one silently is how text ends up as mojibake, so the encoding is a control rather than an assumption. CP949 is included because Korean legacy systems still speak it and no browser can produce it directly — the encoder is built by inverting the browser’s own decoder.

How to use it

  1. Pick the encoding first

    UTF-8 unless you have a reason. CP949 is there because Korean legacy systems still speak it, and a code point is what you want when the question is about Unicode rather than storage.

  2. Choose the base and the formatting

    Separator, zero-padding, upper-case hex and a 0x or 0b prefix. Those decide whether the output pastes cleanly into the place you are taking it.

  3. Paste numbers to go the other way

    Any separator works — spaces, commas, newlines, 0x prefixes. A run with no separators at all is split at 8 digits for binary and 2 for hex.

Common questions

Which encoding does "the binary of a character" mean?

It depends who is asking. A file on disk is bytes in some encoding — usually UTF-8. A JavaScript string is UTF-16. A Unicode reference means the code point. Picking one silently is how text ends up as mojibake, which is why this asks.

Why does a Korean character give three bytes?

In UTF-8, Hangul sits in the three-byte range. In CP949 it is two. That difference is why a name that fits a database column on one system overflows it on another.

Some characters came out as a question mark

The encoding you picked has no code for them — CP949 has no emoji, and no Latin letters outside its own set. The panel lists which characters, and UTF-8 can represent every one of them.

Where does CP949 come from in a browser?

Browsers can decode it but not encode it, so the encoder here is built by inverting the browser’s own decoder — every code is round-tripped once to build the table. That is why the result agrees exactly with what a CP949 file would contain.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.