Base Converter guide
Binary, Decimal, Octal and Hex Conversion Chart
The first sixteen values run 0 to 15 in decimal, 0000 to 1111 in binary, 0 to 17 in octal, and 0 to F in hexadecimal. Those sixteen rows cover one hex digit and four binary digits, which is the pattern everything else is built from.
The first sixteen values
This is the table worth knowing by heart. Everything larger is built out of these.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Powers of two
These are the place values in binary, and the reason computing numbers look the way they do.
| Power | Value | Power | Value |
|---|---|---|---|
| 2⁰ | 1 | 2⁸ | 256 |
| 2¹ | 2 | 2⁹ | 512 |
| 2² | 4 | 2¹⁰ | 1024 |
| 2³ | 8 | 2¹¹ | 2048 |
| 2⁴ | 16 | 2¹² | 4096 |
| 2⁵ | 32 | 2¹⁶ | 65536 |
| 2⁶ | 64 | 2²⁰ | 1048576 |
| 2⁷ | 128 | 2³² | 4294967296 |
Byte boundaries worth recognising
| Decimal | Hex | Binary | What it is |
|---|---|---|---|
| 15 | F | 1111 | One hex digit, four bits |
| 16 | 10 | 10000 | Hex rolls over |
| 127 | 7F | 1111111 | Largest signed byte |
| 128 | 80 | 10000000 | Top bit set |
| 255 | FF | 11111111 | Largest unsigned byte |
| 256 | 100 | 100000000 | Needs a second byte |
| 65535 | FFFF | 16 ones | Largest 16-bit value |
Numbers you will keep meeting
255 turns up everywhere because it is the largest value in one byte. Colour channels run 0 to 255. Network masks use it. If you see 255, a byte is involved.
1024 is 2¹⁰, which is why a kilobyte is 1024 bytes rather than 1000. The same logic gives 1024 KB to a megabyte.
65535 is the largest 16-bit value, which is why there are 65535 usable network ports and why older games so often capped scores or item counts at that number.
4294967295 is the largest 32-bit value — around 4.3 billion. It is the reason 32-bit systems could not address more than 4GB of memory.