Developer tool

Text to binary

Convert text to binary, hex, octal or decimal — and back again.

Text to binary Runs on your device
  • Runs in your browser — your text is never sent anywhere
  • No sign-up, no quotas, free to use as often as you like

How it works

Converting text to its underlying numbers comes up in puzzles, teaching, debugging and protocol work. The detail that trips people up is that text is not characters to a computer — it is bytes, and which bytes depends on the encoding.

UTF-8, which is what matters

Text is encoded as UTF-8 bytes before conversion. Plain English characters are one byte each, so the result looks exactly like the ASCII table most tutorials use. Accented letters take two bytes, and emoji take four — so the byte count and the character count differ, and both are shown.

Grouping

Binary is padded to eight digits per byte, hex to two, octal to three, with a space between bytes. That grouping is what makes the output readable and what lets it be decoded again unambiguously.

Decoding back

Paste groups of numbers separated by spaces and they are read back as bytes and decoded as UTF-8. Any group outside 0–255, or a sequence that is not valid UTF-8, is reported rather than silently producing rubbish.

Which base to choose

Binary is what people mean by “text to binary”. Hex is far more compact and is what you will see in a hex editor or a protocol dump. Octal is mostly historical. Decimal is easiest to read aloud.

FAQ

Text to binary — questions

Why does my emoji produce four numbers?

Emoji are four bytes in UTF-8. The byte count and character count are both shown.

Can it convert binary back to text?

Yes. Paste space-separated groups and it decodes them.

Why does it say my bytes are not valid UTF-8?

The numbers do not form a legal character sequence — usually a missing or extra group.