Hex to Decimal Converter
Convert a hexadecimal number to its exact decimal value, handling arbitrarily large hex numbers correctly.
Enter a hexadecimal number below (with or without a 0x prefix) - this tool converts it to decimal exactly.
More Data / Number / Computer Science Tools
View all 19For the reverse direction, see the Decimal to Hex Converter.
How Hex-to-Decimal Conversion Works
Each hex digit (0-9, A-F) represents a power of 16 based on its position - the decimal value is the sum of each digit's value multiplied by 16 raised to its position.
How to Use It
- Enter a hex number, with or without a leading
0x. - The decimal equivalent appears instantly.
Limitations
This handles arbitrarily large hex integers accurately using BigInt, avoiding the precision loss that plain JavaScript number parsing would introduce for very long hex strings.
Worked Example
Convert 0x1F4 to decimal. Each position is a power of 16:
- 1 × 162 = 1 × 256 = 256
- F (15) × 161 = 240
- 4 × 160 = 4
256 + 240 + 4 = 500.
Common Conversions
| Hex | Decimal | Where you see it |
|---|---|---|
FF | 255 | Maximum of one byte, one colour channel |
100 | 256 | Number of values in a byte |
7FFFFFFF | 2,147,483,647 | Largest signed 32-bit integer |
FFFF | 65,535 | Largest 16-bit value, highest port number |
Tips
- Letters can be upper or lower case -
ffandFFare the same. - Prefixes vary by context:
0xin code,#for colours,U+for Unicode,hsuffix in some assembly languages. - To read a colour like
#1E56E3, convert each pair separately: 1E = 30, 56 = 86, E3 = 227.
Convert back with Decimal to Hex. For binary, use Number Base Converter.
Frequently Asked Questions
Explore More Tools
Keep going with related categories and our most used tools.