Binary: base 2
Every byte in a computer is 8 bits — 8 binary digits, each 0 or 1. The decimal number 13 is 1101 in binary: 8 + 4 + 0 + 1.
| Decimal | Binary | Hex |
|---|---|---|
| 0 | 0000 | 0 |
| 5 | 0101 | 5 |
| 10 | 1010 | A |
| 15 | 1111 | F |
| 255 | 1111 1111 | FF |
| 1024 | 100 0000 0000 | 400 |
Hexadecimal: base 16
Hex uses 0–9 then A–F for the values 10–15. Because 16 = 2⁴, each hex digit corresponds to exactly four binary bits — so one byte fits in two hex characters (00 to FF).
Why colors use hex
A CSS color like #FF8800 stores three bytes — red, green, blue — each 0–255. Hex is just a compact, byte-aligned way to read them.
Try the converter
Bit (b)
Byte (B)
| Unit | 1 b equals |
|---|---|
| Bit (b) | 1 |
| Byte (B) | 0.125 |
| Kilobyte (KB) | 0.000125 |
| Megabyte (MB) | 1.25e-7 |
| Gigabyte (GB) | 1.25e-10 |
| Terabyte (TB) | 1.25e-13 |
| Petabyte (PB) | 1.25e-16 |
| Kibibyte (KiB) | 0.00012207 |
| Mebibyte (MiB) | 1.19209e-7 |
| Gibibyte (GiB) | 1.16415e-10 |
| Tebibyte (TiB) | 1.13687e-13 |
Common mistakes
Bits ≠ bytes
Lowercase b = bit, uppercase B = byte. 100 Mbps (megabits per second) is not 100 MB/s — divide by 8 to get megabytes per second.
Related converters
The tools mentioned in this guide — one tap away.