Quick answer: 1F4 in hex is 500 in decimal: 1×16² + 15×16¹ + 4×16⁰ = 256 + 240 + 4 = 500.
How it's calculated
Hexadecimal is base 16. It uses the digits 0–9 and the letters A–F for 10–15, and each place is worth a power of 16: 16⁰ = 1, 16¹ = 16, 16² = 256.
Hex to decimal: multiply each digit by its place value and add. Decimal to hex: divide by 16 repeatedly and read the remainders from the last to the first.
Hex and binary convert digit by digit, because 16 = 2⁴: each hex digit is exactly 4 bits, so 1F4 = 0001 1111 0100. This is why hex is used for colours (#FF8800), memory addresses and byte values. For base 2 on its own, use the binary calculator.
Worked examples
- Hex to decimal: 1F4₁₆ = 256 + 240 + 4 = 500
- Decimal to hex: 255 = FF₁₆
- Hex addition: FF₁₆ + 1A₁₆ = 119₁₆ (255 + 26 = 281)
Hex digits
| Hex | Decimal | Binary |
|---|---|---|
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
| 10 | 16 | 1 0000 |
| FF | 255 | 1111 1111 |
Frequently asked questions
What does 0x mean?
It is a prefix that marks a number as hexadecimal in programming, as in 0x1F4. You can type it or leave it out.
How is a colour like #FF8800 read?
As three bytes: red FF = 255, green 88 = 136 and blue 00 = 0.
Are lower-case letters allowed?
Yes. 1f4 and 1F4 are the same number; results are shown in upper case.
What is 1F4 in decimal?
500. That's 1 lot of 256, 15 lots of 16, and 4.
What is FF + 1A in hex?
119, which is 255 + 26 = 281 in everyday numbers.
How do I turn an RGB colour into hex?
Write red, green and blue (each 0 to 255) as two hex digits each. rgb(255, 136, 0) becomes #FF8800.