Binary and Hexadecimal, Explained

How computers count — and why hex shows up everywhere from color codes to memory dumps.

6 min read 4 sections Updated May 7, 2026
binaryhexdata
On this page(4)

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.

DecimalBinaryHex
000000
501015
101010A
151111F
2551111 1111FF
1024100 0000 0000400

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

Data unit converter

Bit (b)

Byte (B)

Unit1 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.

Keep reading

One email a month

Get the best new converters & calculators.

Hand-picked tools, useful conversion tips, no spam — unsubscribe in one click.

Keep exploring

Your next conversion is one tap away.

Trending tools, your recent picks, and smart suggestions — curated, not cluttered.