Hexadecimal (base 16)
Hexadecimal, or hex, is the base-16 number system.
Convert hexadecimal to any number system
FF hexadecimal = 11111111 binary
Quick facts
- System
- Hexadecimal
- Base (radix)
- 16
- Digits
0 1 2 3 4 5 6 7 8 9 A B C D E F- Notes
- Sixteen digits: 0–9 then A–F (A = 10 … F = 15).
- Also called
- hex, base 16, 0x prefix
- Example
FF= 255 in decimal
FF in other systems
| Binary | 11111111 |
| Decimal | 255 |
| Roman numerals | CCLV |
| Octal | 377 |
| Duodecimal | 193 |
| Ternary | 100110 |
| Base 36 | 73 |
| Vigesimal | CF |
How hexadecimal works
Hexadecimal, or hex, is the base-16 number system. It uses the digits 0 to 9 and then the letters A to F for the values 10 to 15. Each position is worth sixteen times the one to its right, so FF is 15 × 16 + 15 = 255.
Because 16 = 2⁴, each hex digit corresponds to exactly four bits, and every byte is two hex digits. That makes hex the standard way for programmers to write binary data compactly. Hex numbers are often written with a 0x prefix (0xFF) or a # for colors (#FF8800).
Each position is worth 16 times the position to its right: 1, 16, 256, 4,096, 65,536 and so on. So FF means F × 161 + F × 160 = 255.
Where hexadecimal is used
- Web and design colors: #1E3A8A is red 30, green 58, blue 138.
- Memory addresses, machine code and debugging.
- MAC addresses, IPv6 addresses and Unicode code points (U+00E9).
- Hashes and checksums such as SHA-256 and MD5.
Hexadecimal chart
| Hexadecimal | Binary | Decimal | Roman numerals | Octal |
|---|---|---|---|---|
0 |
0 | 0 | – | 0 |
1 |
1 | 1 | I | 1 |
2 |
10 | 2 | II | 2 |
3 |
11 | 3 | III | 3 |
4 |
100 | 4 | IV | 4 |
5 |
101 | 5 | V | 5 |
6 |
110 | 6 | VI | 6 |
7 |
111 | 7 | VII | 7 |
8 |
1000 | 8 | VIII | 10 |
9 |
1001 | 9 | IX | 11 |
A |
1010 | 10 | X | 12 |
B |
1011 | 11 | XI | 13 |
C |
1100 | 12 | XII | 14 |
D |
1101 | 13 | XIII | 15 |
E |
1110 | 14 | XIV | 16 |
F |
1111 | 15 | XV | 17 |
10 |
10000 | 16 | XVI | 20 |
11 |
10001 | 17 | XVII | 21 |
12 |
10010 | 18 | XVIII | 22 |
13 |
10011 | 19 | XIX | 23 |
14 |
10100 | 20 | XX | 24 |
20 |
100000 | 32 | XXXII | 40 |
32 |
110010 | 50 | L | 62 |
40 |
1000000 | 64 | LXIV | 100 |
64 |
1100100 | 100 | C | 144 |
80 |
10000000 | 128 | CXXVIII | 200 |
FF |
11111111 | 255 | CCLV | 377 |
100 |
100000000 | 256 | CCLVI | 400 |
1F4 |
111110100 | 500 | D | 764 |
3E8 |
1111101000 | 1000 | M | 1750 |
400 |
10000000000 | 1024 | MXXIV | 2000 |
History
Hexadecimal notation became standard in computing in the 1960s, popularized by IBM's System/360, whose 8-bit bytes split neatly into two hex digits. The letters A–F were settled on after earlier machines had used other symbols.
Convert hexadecimal to…
Convert to hexadecimal
Numbers in hexadecimal
Frequently asked questions
What is hexadecimal?
Hexadecimal, or hex, is the base-16 number system.
Which symbols does hexadecimal use?
Sixteen digits: 0–9 then A–F (A = 10 … F = 15).
How do you write 10 in hexadecimal?
10 in hexadecimal is A.
How do you write 100 in hexadecimal?
100 in hexadecimal is 64.