Hex to Decimal Converter
The hex to decimal converter multiplies each hexadecimal digit by its power of 16 and adds the results: 2F = 2 × 16 + 15 × 1 = 47. A leading # is ignored, so colour codes such as #1A work too.
Sources: Wikipedia, W3C Updated
How to convert hex to decimal
Each hexadecimal digit is worth a power of 16, read from the right starting at 16⁰ = 1. Take 2F.
- Turn any letters into numbers: A = 10, B = 11 and so on, so F = 15.
- Multiply each digit by its place value: 2 × 16 = 32 and 15 × 1 = 15.
- Add the results: 32 + 15 = 47.
Type 2F into the box and the tool returns Decimal: 47, worked out with JavaScript's parseInt(hex, 16). The same idea with powers of 2 is the binary to decimal converter.
Hex colour codes and the # prefix
The box is built with colour codes in mind: a leading # is removed before converting, so #1A and 1A both give 26. Anything other than 0 to 9 and A to F in either case gives "Invalid hex value. Use only 0-9 and A-F" instead of a wrong answer.
A six-digit CSS colour is three two-digit hex numbers for red, green and blue. #FF8000 is red FF = 255, green 80 = 128 and blue 00 = 0, an orange. Convert each pair on its own to get the three channel values.
Hex to decimal chart
| Hex | Decimal | Hex | Decimal |
|---|---|---|---|
| A | 10 | 80 | 128 |
| F | 15 | FF | 255 |
| 10 | 16 | 100 | 256 |
| 1A | 26 | 3E8 | 1000 |
| 2F | 47 | FFFF | 65535 |
| 64 | 100 | FFFFFF | 16777215 (white in RGB) |
Powers of 16
The place values from the right are 1, 16, 256, 4,096, 65,536 and 1,048,576. A hex number with n digits can be as large as 16ⁿ − 1, so two digits reach 255 and four reach 65,535.
Because 16 = 2⁴, each hex digit is also four binary digits; the hex to binary converter uses that. For octal and the other directions, use the hex converter, and all the tools are on the number system converters page.
Hex to Decimal Converter: FAQ
What is FF in decimal?
255. F is 15, so FF = 15 × 16 + 15 = 255, the largest value of one byte.
Is hex case sensitive?
No. 2f and 2F are the same number, and the converter accepts both.
How do I convert decimal back to hex?
Divide by 16 again and again and read the remainders from the bottom up. The decimal to hexadecimal converter shows each division.
Sources
- Wikipedia: Hexadecimal — hex digits and place values as powers of 16 (checked October 16, 2026)
- W3C CSS Color Module Level 4 — hex colour notation such as #FF8000 (checked October 16, 2026)