Text to Binary Converter — Binary, Hex, Octal & Decimal, Both Ways

Real UTF-8 bytes in, correctly padded codes out — and back again, separators or not.

🔒 Runs in your browser — files never uploaded ⚡ No signup 💯 Free

Convert text to binary, hexadecimal, octal or decimal byte codes — and convert any of those back to text. The conversion works on the text's actual UTF-8 bytes, so accented letters, symbols and emoji come out as the multi-byte sequences a file or network really contains, and decode back to the same characters.

Paste separated codes or one continuous run of digits; both are understood.

How to use Text to Binary Converter

  1. Choose the direction — Text → code, or Code → text.
  2. Pick the format: binary, hex, octal or decimal.
  3. Type or paste. Output updates live; the counters show characters, bytes and bits.
  4. Copy, or Swap to feed the output back in and confirm it round-trips.

How text becomes numbers

A computer stores text as bytes, and a character encoding says which bytes mean which characters. Today that encoding is UTF-8 essentially everywhere. ASCII characters — the Latin alphabet, digits, common punctuation — are one byte each: H is 72, which is 01001000 in binary or 48 in hex. Everything else takes more: é is two bytes (C3 A9), is three, an emoji is four. Converters that treat each character as one byte are wrong for every one of those, and this one is not.

Reading the four formats

  • Binary — eight digits per byte, always padded. 01001000, never 1001000; the leading zero is data.
  • Hexadecimal — two digits per byte, the compact way to write the same bits. What you see in hex editors and \x48 escapes.
  • Octal — three digits per byte, capped at 377. Survives in \110-style escapes and Unix permissions.
  • Decimal — the byte's value in ordinary numbers, 0–255. Readable, but needs separators: 72105 could be 72 105 or 7 210 5, so decimal input must be space- or comma-separated.

Decoding forgivingly

Codes may be separated by spaces, commas, newlines or nothing at all. A continuous run is split into fixed-width chunks — 8 binary digits, 2 hex, 3 octal — so 0100100001101001 decodes as Hi. Prefixes like 0x and 0b are stripped. Anything that is not a valid digit, or a value above 255, is reported with the exact token that failed rather than silently dropped; and bytes that do not form valid UTF-8 are reported as such instead of being replaced with question marks.

Related conversions

To convert a single number between bases (rather than each byte of a text), use the number base converter. To encode text or files for transport in a printable form, Base64 is the standard answer — six bits per character instead of eight binary digits per byte.

Frequently asked questions

Why does "é" become two binary numbers?

Because in UTF-8 — the encoding of essentially all modern text — é is stored as two bytes, C3 A9. One "character" is not one byte once you leave plain ASCII; emoji are four bytes. The converter shows what a file or network actually carries, and decodes those bytes back to the right character.

Do I need spaces between the binary bytes when decoding?

No. A continuous string is split into 8-digit chunks (2 for hex, 3 for octal), as long as its length is a multiple of that width. Decimal is the exception — 72105 is ambiguous — so decimal bytes must be separated.

What is "binary code" for a letter?

Its byte value written in base 2. Capital A is 65, so 01000001; lowercase a is 97, 01100001 — note the single bit (value 32) that differs between cases. Type the alphabet to see the pattern.

Why is my hex input rejected with "not valid UTF-8"?

The digits are fine but the bytes they describe don't form a valid text sequence — often because the source was a different encoding (Latin-1, UTF-16) or isn't text at all (a hash, a binary file). Rather than showing question marks, the tool says so.

How is this different from Base64?

Binary/hex/octal show each byte as a number — readable, but two to eight characters per byte. Base64 is a compact transport encoding (four characters per three bytes) designed for embedding binary data in text. For that, use the Base64 tool.