How to convert text to binary
- Type or paste text into Input · Text. The binary appears in Output · Binary immediately.
- Separator under the output sets what goes between bytes: Space, None,
,,,or New line. - Charset under the input decides how characters become bytes. UTF-8 is the default and matches ASCII for English text.
- Copy output or Download to keep the result. Paste binary into Binary to Text, or use the Binary → Text toggle, to go back.
A word, letter by letter
Hello in binary is 01001000 01100101 01101100 01101100 01101111. Here is where each group comes from:
| Letter | Decimal | Binary |
|---|---|---|
H | 72 | 01001000 |
e | 101 | 01100101 |
l | 108 | 01101100 |
l | 108 | 01101100 |
o | 111 | 01101111 |
The decimal number is the character’s ASCII code; the binary is the same number in base 2, padded to 8 digits. Notice that H and h (01101000) differ only in the third bit from the left. Every uppercase and lowercase pair in ASCII works that way, which is why programs can change case with a single bit operation.
Separator styles
The same two letters Hi in each Separator setting:
| Separator | Output |
|---|---|
| Space | 01001000 01101001 |
| None | 0100100001101001 |
, | 01001000, 01101001 |
, | 01001000,01101001 |
| New line | one byte per line |
Spaces are easiest to read and to check. The unbroken form is what you need for a bit string in a puzzle or a protocol spec, but a single lost digit shifts everything after it, so keep a spaced copy. The comma forms paste into code or a spreadsheet cell, though for real source code Base64 to Byte Array writes a proper array literal.
Characters outside ASCII
Plain English letters, digits and punctuation are one byte each. Everything else is longer in UTF-8, and the converter writes every byte:
| Text | Bytes | Binary (UTF-8) |
|---|---|---|
ñ | 2 | 11000011 10110001 |
中 | 3 | 11100100 10111000 10101101 |
🙂 | 4 | 11110000 10011111 10011001 10000010 |
Switch Charset and the bits change with it. In UTF-16LE, Hi becomes 01001000 00000000 01101001 00000000, two bytes per letter with the zero byte second. If someone else’s binary for the same text differs from yours, compare charsets before anything else.
Text, binary and Base64
Binary is the most literal way to write bytes and also the longest: 8 characters per byte, plus separators. Base64 writes the same bytes in about 1.33 characters each, which is why it is used to carry files and keys inside text formats. Hi is SGk= in Base64, and Text to Base64 produces that directly. To watch the 8-bit groups being regrouped into the 6-bit pieces Base64 uses, convert with Base64 to Binary and read how Base64 works.
Text to binary in code
" ".join(f"{b:08b}" for b in "Hi".encode("utf-8")) # '01001000 01101001'
Array.from(new TextEncoder().encode("Hi"),
b => b.toString(2).padStart(8, "0")).join(" "); // '01001000 01101001'
The 08b format and padStart(8, "0") add the leading zeros. Without them, H comes out as 1001000 and the groups no longer line up. More string and byte handling is on the Python and JavaScript pages.
FAQ
What is "hello" in binary?
01101000 01100101 01101100 01101100 01101111. Capitalised, Hello only changes the first group, to 01001000.
How do I write my name in binary?
Type it into the input and copy the output. Each letter becomes 8 digits; a space between first and last name becomes 00100000.
Why is each character exactly 8 digits long?
Computers store text in bytes, and a byte has 8 bits. The converter pads every byte with leading zeros, so A (65) is written 01000001, not 1000001.
Why do some characters produce 16 or 32 bits?
They need more than one byte in UTF-8. ñ takes two bytes, 中 three and an emoji four. In UTF-16 even plain letters take two bytes.