Text to binary, byte by byte
Binary is how computers store everything, including text. A text to binary conversion shows the bits behind each character: the tool encodes your text as UTF-8 and writes every byte as an 8-digit binary number, padded with leading zeros so each group has exactly eight bits.
Example
Input:
Hi there!Output:
01001000 01101001 00100000 01110100 01101000 01100101 01110010 01100101 00100001The letter H is 72 in decimal, which is 01001000 in binary: 64 + 8 = 72.
Reading a binary byte
Each position in a byte has a value, doubling from right to left:
| Bit | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
01001000 (H) | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 |
01101001 (i) | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
Add up the values where the bit is 1 and you get the character code: 64 + 32 + 8 + 1 = 105 for “i”.
Beyond ASCII
ASCII characters fit in one byte and always start with 0. Other characters use two to four bytes in UTF-8, and each of those bytes starts with 1. For example, “é” becomes 11000011 10101001. The leading 110 marks the start of a two-byte sequence and 10 marks a continuation byte — a neat way to see UTF-8’s structure.
Separator options
- Space — the most readable form, one byte per group.
- None — a continuous bit stream, handy for puzzles or bit-level exercises.
- New line — one byte per line, easy to annotate or paste into a spreadsheet.
Text to binary in code
Python: ' '.join(f'{b:08b}' for b in 'Hi'.encode()). JavaScript: [...new TextEncoder().encode('Hi')].map(b => b.toString(2).padStart(8, '0')).join(' '). Both give the same result as this tool because they work on UTF-8 bytes.
Uses
Teaching how computers represent text, preparing puzzle or escape-room clues, creating binary-themed designs, and checking bit patterns in low-level programming. Binary is not encryption; anyone can translate it back.
Translate back with Binary to Text. For numbers rather than text, use Decimal to Binary, and for a per-character table with decimal, hex and binary, try Char to ASCII. The conversion runs in your browser.
How many bits does your text take?
Because the output shows every UTF-8 byte, you can read the storage size straight from it: count the groups and multiply by eight. “Hello” is 5 groups, or 40 bits. The count depends on the characters, not just their number:
| Character | UTF-8 bytes | Binary |
|---|---|---|
| A | 1 | 01000001 |
| é | 2 | 11000011 10101001 |
| € | 3 | 11100010 10000010 10101100 |
| 😀 | 4 | 11110000 10011111 10011000 10000000 |
JavaScript's charCodeAt works on UTF-16 instead and would describe the emoji as two 16-bit units, so its binary looks completely different. When results from a program disagree with this tool, check which encoding the program uses.