What is Hexadecimal
Hexadecimal (hex) is the base-16 number system. It uses sixteen symbols: 0-9 for values zero through nine, and A-F for values ten through fifteen. Hex exists because binary is hard for humans to read, and hex provides a compact, lossless shorthand — each hex digit maps to exactly 4 bits.
How it works
In base-16, each position represents a power of 16. The hex number 2F means 2 x 16 + 15 x 1 = 47 in decimal. But the real power of hex is its direct relationship with binary:
Hex: 2 F
Binary: 0010 1111
Every hex digit corresponds to a 4-bit pattern, no math required. This makes conversion between hex and binary instant and mechanical. A full byte (8 bits) is always exactly two hex digits: FF = 11111111 = 255.
You see hex everywhere in computing:
- Colors —
#FF8800is a hex color.FF= maximum red (255),88= medium green (136),00= no blue. - Memory addresses —
0x7FFF5FBFF8A0is a pointer printed in hex. The0xprefix signals hexadecimal. - Character encoding — UTF-8 byte values are written in hex. The euro sign is
E2 82 AC(three bytes). - Debugging — hex dumps show raw file contents. Each byte is two hex characters, far more readable than eight binary digits.
Why it matters
Binary is the truth, but it's unwieldy. The 32-bit integer 11000000101010000000000100000001 is hard to parse at a glance. In hex, the same value is C0A80101 — immediately recognizable to a network engineer as the IP address 192.168.1.1.
Hex doesn't add abstraction. It doesn't hide information. It's just a more human-friendly way to look at binary data. Any time you work with raw bytes — debugging, networking, cryptography, low-level programming — you'll read and write hex.
See How Binary Works for conversion techniques between binary, hex, and decimal.