Characters in binary
| Character | Code point | Binary (UTF-8 bytes) |
|---|---|---|
| A | 65 | 01000001 |
| a | 97 | 01100001 |
| 0 | 48 | 00110000 |
| space | 32 | 00100000 |
| é | 233 | 11000011 10101001 |
Binary in code
" ".join(f"{b:08b}" for b in "Hi".encode()) # '01001000 01101001'
bytes(int(b, 2) for b in "01001000 01101001".split()).decode() # 'Hi'
const toBinary = (s) => [...new TextEncoder().encode(s)].map((b) => b.toString(2).padStart(8, '0')).join(' ');
const fromBinary = (s) => new TextDecoder().decode(Uint8Array.from(s.trim().split(/\s+/), (b) => parseInt(b, 2)));
Hex is a shorter way to write the same bytes: try hex to text. For single numbers, use the number base converter.
Frequently asked questions
How does text become binary?
Each character is first turned into bytes with UTF-8, and each byte is written as 8 binary digits. The letter A is byte 65, which is 01000001 in binary. Characters outside ASCII take more bytes: é is two bytes and an emoji four, so it becomes 32 bits.
How do I read binary back as text?
Paste it in; the tool switches to “Binary → Text” when the input is only 0s, 1s and spaces. Groups separated by spaces are read as one byte each, and a group shorter than 8 bits is padded on the left (1000001 reads as 01000001). A single long run without spaces must be a multiple of 8 bits.
Why is A 01000001 and a 01100001?
In ASCII, uppercase and lowercase letters are exactly 32 apart, which is one bit: the third bit from the left. Flipping that bit switches case, which is why old programs converted case with a single bitwise operation.
Can I convert a number to binary here?
This tool converts text, so typing 5 gives the binary of the character “5” (00110101), not of the number five (101). For numbers, use the number base converter, which handles any size and two’s complement.