Everything a computer stores, from this sentence to your photos, is ultimately a long list of 0s and 1s. Here's how binary numbers work, and how text becomes binary code, explained without the jargon.
Counting in binary
We normally count in base 10: each position in a number is worth ten times the one to its right (ones, tens, hundreds). Binary is base 2: each position is worth twice the one to its right.
| Position value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| 65 in binary | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
So 01000001 means 64 + 1 = 65. Eight binary digits (bits) make a byte, which can hold any number from 0 to 255.
How text becomes numbers
Computers store letters as numbers using an agreed table. The original one, ASCII, gave every English letter, digit and
common symbol a number: capital A is 65, lowercase a is 97, the digit 0 is 48 and a space is 32. So “Hi” is 72 and 105,
or 01001000 01101001 in binary.
Emoji and other languages: UTF-8
ASCII only had room for English. Today almost every website uses UTF-8, which keeps the ASCII numbers for basic English and uses two, three or four bytes for everything else: accented letters, Arabic, Chinese, Sinhala and emoji. That's why “é” becomes 2 bytes of binary and 😀 becomes 4.
Hexadecimal: binary for humans
Long strings of 0s and 1s are hard to read, so programmers often write bytes in hexadecimal (base 16), using 0–9 and A–F.
Each hex digit stands for exactly four bits, so one byte is always two hex digits: 65 is 41, 255 is
FF. You'll see hex in colour codes like #FF5A1F and in error messages.
Try it
Type anything into the binary translator to see it as binary, hexadecimal, decimal or octal, or paste binary to decode a secret message. For another kind of code, try the Morse code translator.