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

Binary11111111
Decimal255
Roman numeralsCCLV
Octal377
Duodecimal193
Ternary100110
Base 3673
VigesimalCF

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

HexadecimalBinaryDecimalRoman numeralsOctal
0 00–0
1 11I1
2 102II2
3 113III3
4 1004IV4
5 1015V5
6 1106VI6
7 1117VII7
8 10008VIII10
9 10019IX11
A 101010X12
B 101111XI13
C 110012XII14
D 110113XIII15
E 111014XIV16
F 111115XV17
10 1000016XVI20
11 1000117XVII21
12 1001018XVIII22
13 1001119XIX23
14 1010020XX24
20 10000032XXXII40
32 11001050L62
40 100000064LXIV100
64 1100100100C144
80 10000000128CXXVIII200
FF 11111111255CCLV377
100 100000000256CCLVI400
1F4 111110100500D764
3E8 11111010001000M1750
400 100000000001024MXXIV2000

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.