Binary vs Hexadecimal
The two number systems that power every computer — one verbose, one compact.
| Binary (base 2) | Hexadecimal (base 16) | |
|---|---|---|
| Digits | 0, 1 | 0–9, A–F |
| 1 byte | 8 digits (e.g. 10110010) | 2 digits (e.g. B2) |
| Used in | Hardware, bit-level logic | Memory addresses, colors |
- Matches actual transistor state
- Trivial bitwise operations
- 4× more compact than binary
- Direct conversion (4 bits = 1 hex digit)
When to use which
Use binary when reasoning about bit-level operations and hardware.
Use hex for human-readable memory dumps, color codes (#FF6B35), and crypto hashes.
Historical context
Binary dates to Leibniz's 1703 paper on the I Ching; hex emerged in the 1960s as a compact way to print binary memory dumps. IBM's System/360 cemented the modern hex convention.
Practical recommendation
Related tools
FAQs
Why hex over octal?+
Hex maps cleanly to byte boundaries (2 digits = 1 byte). Octal needs 3 bits per digit and doesn't align.
Explore the topic
Knowledge graphMore comparisons
Two measurement systems that govern most of the world's specs and product packaging.
Two everyday temperature scales — same physics, different zero points and step sizes.
Two units of pressure that show up on every tire gauge, espresso machine and air compressor.
The three data-storage tiers everyone meets — and how SI decimal differs from binary IEC units.