Skip to content
🔤

Text To Binary

Convert any text to binary code instantly.

Runs in your browser

Updated

One character, one group

Each character is read with charCodeAt, converted to base 2 and padded on the left to eight digits. Groups are joined with a single space and the final space is trimmed, so "Hi" comes out as "01001000 01101001", two groups and 17 characters. The output box is read-only with a copy button, and the input is never trimmed.

A worked example

"Hi" produces 17 characters. "SOS" produces "01010011 01001111 01010011", 26 characters in three groups. The euro sign is 8364 in decimal, which needs 14 bits, so "A€" becomes "01000001 10000010101100": one eight-digit group followed by a fourteen-digit one. Padding only ever adds zeros, never removes digits, which is why longer code points make longer groups instead of being cut short.

What eight bits really means

For ASCII the output matches the byte you would find in a file. Above 127 the number is a code point, not necessarily a byte: é is 233, written 11101001, while the same letter in UTF-8 is the two bytes 11000011 10101001. Characters outside the Basic Multilingual Plane are stored as surrogate pairs, so an emoji becomes two sixteen-digit groups. All of it is reversible here, and none of it is portable to a byte-oriented decoder.

Spacing and size

There is one separator, a single space, and it cannot be changed. That keeps the output readable but awkward for a parser expecting a continuous stream, and it multiplies the size by about nine: a 1,000-character paragraph becomes roughly 9,000 characters before the last space is trimmed.

Where it stops

  • No UTF-8 output, so accented and non-Latin text does not match a file's bytes.
  • No separator or grouping options and no continuous bitstream mode.
  • No file input, no batch conversion and no way to set a character encoding.
  • Emoji become two groups that only a decoder using the same convention can reassemble.

Questions people ask

Why does an accented letter not match the file?

Because the page encodes the code point while files store UTF-8 bytes, and eight digits only line up for plain ASCII. The unicode converter shows the code points themselves.

Can I turn binary back into text?

Yes, through the binary to text page. For hexadecimal, octal and decimal conversions, use the number base converter.