Hexadecimal (hex) is a base-16 number system. Where binary uses two digits (0–1) and denary uses ten (0–9), hexadecimal uses sixteen: 0–9 followed by A–F to represent the values ten through fifteen in a single character.
Computers store everything in binary, but long binary strings — for example, a 32-bit memory address — are difficult to read and prone to transcription error. Hexadecimal solves this by providing a compact notation: every 4 binary bits map exactly to a single hex digit, making the conversion lossless.
| Where hex appears | Example |
|---|
| Web colour codes | #FF5733 |
| Memory addresses | 0x1A2F |
| MAC addresses | A8:5E:45:6B:3C:71 |
| Error codes | 0x000000ED |
Hex is used in computing not because it is intuitive, but because 4 bits = 1 hex digit. Binary-to-hex conversion is exact, with no rounding or information loss.