Hex to decimal
Type a hexadecimal number and get the decimal value, with the working. Handles any length and a 0x or # prefix.
How hex to decimal works
Hexadecimal is base 16. It uses sixteen digits: 0 to 9 and then A to F for the values ten to fifteen. Each position is worth 16 times the one to its right, so the digits from right to left are worth 1, 16, 256, 4,096 and so on.
To convert, multiply each digit by its place value and add the results. For 1F4: 1×256 + 15×16 + 4×1 = 256 + 240 + 4 = 500. The converter shows the same working for whatever you type.
Hex digits
| Hex digit | Decimal | Binary |
|---|---|---|
0 | 0 | 0000 |
1 | 1 | 0001 |
2 | 2 | 0010 |
3 | 3 | 0011 |
4 | 4 | 0100 |
5 | 5 | 0101 |
6 | 6 | 0110 |
7 | 7 | 0111 |
8 | 8 | 1000 |
9 | 9 | 1001 |
A | 10 | 1010 |
B | 11 | 1011 |
C | 12 | 1100 |
D | 13 | 1101 |
E | 14 | 1110 |
F | 15 | 1111 |
Common values
| Decimal | Hex | Binary |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 9 | 9 | 1001 |
| 10 | A | 1010 |
| 15 | F | 1111 |
| 16 | 10 | 10000 |
| 32 | 20 | 100000 |
| 64 | 40 | 1000000 |
| 100 | 64 | 1100100 |
| 127 | 7F | 1111111 |
| 128 | 80 | 10000000 |
| 192 | C0 | 11000000 |
| 200 | C8 | 11001000 |
| 255 | FF | 11111111 |
| 256 | 100 | 100000000 |
| 1,000 | 3E8 | 1111101000 |
| 4,095 | FFF | 111111111111 |
| 65,535 | FFFF | 1111111111111111 |
How big can a hex number get?
Each extra hex digit multiplies the range by 16. Two digits cover 0 to 255, which is one color channel or one byte.
| Hex digits | Largest value | Decimal |
|---|---|---|
| 1 | F | 15 |
| 2 | FF | 255 |
| 3 | FFF | 4,095 |
| 4 | FFFF | 65,535 |
| 6 | FFFFFF | 16,777,215 |
| 8 | FFFFFFFF | 4,294,967,295 |
Hex numbers and hex colors
A hex color code such as #9CAF88 is three hex numbers side by side: red 9C = 156, green AF = 175 and blue 88 = 136. That is why each channel runs from 0 to 255, because FF is the largest two-digit hex number. If the hex number has exactly six digits, the converter also shows it read as a color. For color work, the hex to RGB and RGB to hex converters split a code into its three channels for you.
Things that trip people up
- Hex 10 is sixteen, not ten. The digits run 0 to F before the number carries.
- Letters are numbers. A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
- Prefixes are not part of the number. 0x1F4, #1F4 and 1F4 are the same value. This converter ignores the prefix.
- Leading zeros change nothing. 00FF and FF are both 255. They matter only for fixed-width fields, such as a six-digit color code.
Related converters
Frequently asked questions
How do I convert hex to decimal?
Multiply each hex digit by 16 raised to its position, counting from 0 on the right, and add the results. For 1F4: 1×16² + 15×16¹ + 4×16⁰ = 256 + 240 + 4 = 500.
What is FF in decimal?
255. F is 15, so FF is 15×16 + 15 = 255, the largest value of one color channel in a hex color code.
Does it matter if I use uppercase or lowercase letters?
No. A to F and a to f mean the same digits. A leading 0x or # is also accepted and ignored.
What is the hex 10 in decimal?
16. Hex digits count from 0 to F, so the number after F is 10, which is sixteen.
Content updated