How Hexadecimal Works
Hexadecimal (base-16) uses sixteen digits: 0–9 and A–F, where A=10, B=11, C=12, D=13, E=14, F=15. Hex is the dominant shorthand for binary data in software development.
Why Hexadecimal?
Each hex digit maps to exactly 4 binary bits. Two hex digits represent one byte (8 bits). This makes hex a compact, human-readable format for binary data — far more readable than long strings of 0s and 1s.
Place Values
Hex uses powers of 16. The rightmost digit is 16⁰ (1). Moving left: 16¹ (16), 16² (256), 16³ (4096), 16⁴ (65536). So 0xFF = 15×16 + 15 = 255.
Hex in Practice
You see hex everywhere in programming: memory addresses (0x7fff5fbff8a0), color codes (#FF5733), SHA hashes, UUIDs, and network MAC addresses. The "0x" prefix is a programming convention indicating hex.
Hex and Binary
Converting between hex and binary is pure digit substitution — no arithmetic needed. F → 1111, A → 1010, 3 → 0011, and so on. This is why developers prefer hex over decimal for inspecting binary data.