How ASCII and UTF-8 work
Computers only understand numbers, so every character you type has a number assigned to it. The oldest and most famous table is ASCII, which gives a code from 0 to 127 to English letters, digits and basic symbols. "A" is 65, "a" is 97, the space is 32. When text contains accents, emoji or characters from other alphabets, UTF-8 comes into play — an encoding that extends ASCII and can represent more than a million distinct characters.
Why 8 bits make a byte
A bit is the smallest unit: it is either 0 or 1. Grouping 8 bits forms a byte, which can take 256 distinct values (2 to the 8th power). That is more than enough for the 128 ASCII characters, which is why historically one character equalled one byte. Each bit inside the byte represents a power of two: 128, 64, 32, 16, 8, 4, 2, 1. Adding up the positions that hold a 1 reconstructs the number. For example, 01000001 is 64 + 1 = 65, which is "A".
Multibyte characters: the magic of UTF-8
UTF-8 is clever because it is backward compatible: the first 128 codes are identical to ASCII and take a single byte. For everything else it uses 2, 3 or 4 bytes as needed. "ñ" is encoded with 2 bytes, the euro sign "€" with 3, and many emoji with 4. That is why, when you convert a phrase with accents, you will see more 8-bit groups than characters. This tool uses TextEncoder, the browser's native API, which produces exactly the same bytes as any real UTF-8 file.
From binary back to text
The reverse process groups the bits into eights, converts each group to its number, and asks TextDecoder to rebuild the characters, joining multibyte sequences where needed. We accept binary with spaces between bytes or run together; the only requirement is that the total number of bits is a multiple of 8 and that there are no characters other than 0 and 1. If something does not add up, we tell you with an error instead of returning broken text.
What converting text to binary is for
- Understanding how data is really stored in a computer.
- Programming, networking or systems exercises and homework.
- Debugging encoding issues (why "ñ" shows up instead of "ñ").
- Games, puzzles and hidden messages in binary.
- Teaching the relationship between characters, bytes and bits.
Reference: common characters in binary
| Character | Decimal | Binary | Hex |
|---|---|---|---|
| A | 65 | 01000001 | 41 |
| a | 97 | 01100001 | 61 |
| 0 | 48 | 00110000 | 30 |
| (space) | 32 | 00100000 | 20 |
| ! | 33 | 00100001 | 21 |