Number Systems

Understanding the Hexadecimal Number System

A complete guide to base-16 numbers and why they matter in computing.

Published: May 8, 2026 · 8 min read

What Is Hexadecimal?

Hexadecimal, often abbreviated as "hex," is a base-16 numeral system. Unlike the decimal system (base 10) which uses ten digits (0–9), hexadecimal uses sixteen symbols: the digits 0–9 and the letters A–F. Here, A represents 10, B represents 11, C represents 12, D represents 13, E represents 14, and F represents 15.

This system was widely adopted in computing because it provides a human-friendly way to represent binary data. Since 16 is a power of 2 (specifically 2⁴), each hexadecimal digit maps directly to exactly four binary bits. This clean mapping makes hex the go-to notation for binary values.

Why Does Hexadecimal Matter?

In the world of computing, everything ultimately boils down to binary — ones and zeros. But reading long strings of binary digits is tedious and error-prone. A single byte (8 bits) like 11010110 is much easier to read as its hex equivalent: D6.

Here are the key areas where hexadecimal is essential:

Memory Addresses: RAM locations are expressed in hex (e.g., 0x7FFF5FBFF8A0).
Color Codes: Web colors like #FF5733 are hex RGB values.
MAC Addresses: Network hardware IDs use hex (e.g., 00:1A:2B:3C:4D:5E).
Assembly Language: Machine instructions and opcodes are written in hex.
File Signatures: Magic numbers that identify file types are hex values (e.g., PDF starts with 25 50 44 46).

Hex vs Binary vs Decimal

Let's compare how the number 255 looks in each system:

Decimal: 255
Binary: 11111111
Hexadecimal: FF

Notice how hex is the most compact. For larger values, the difference is even more dramatic. A 32-bit memory address that would be 32 binary digits long can be expressed in just 8 hex digits.

How Hex Digits Map to Binary

Each hex digit corresponds to exactly 4 bits (a nibble). This is what makes hex so useful:

0 = 0000   • 4 = 0100   • 8 = 1000   • C = 1100
1 = 0001   • 5 = 0101   • 9 = 1001   • D = 1101
2 = 0010   • 6 = 0110   • A = 1010   • E = 1110
3 = 0011   • 7 = 0111   • B = 1011   • F = 1111

Counting in Hexadecimal

Counting in hex follows the same pattern as decimal, but the "rollover" happens at 16 instead of 10:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, ..., 19, 1A, 1B, ..., 1F, 20, ...

So 10 in hex equals 16 in decimal, 20 in hex equals 32, and FF equals 255 — the maximum value of a single byte.

The 0x Prefix Convention

In programming, hex values are typically prefixed with 0x to distinguish them from decimal numbers. For example, 0xFF clearly means "hexadecimal FF" (decimal 255), while 255 is understood as decimal. Different languages use different conventions — CSS uses # for color codes, and some assembly languages use a trailing h.

Ready to Convert?

Now that you understand hexadecimal, try our Decimal to Hex Converter to see the conversion process animated step by step. You can also explore our full suite of conversion tools for binary, octal, and more.