What is a hex to decimal converter?
A hex to decimal converter reads a base-16 string such as 0xde0b6b3a7640000 and returns the same number in base 10 (here 1,000,000,000,000,000,000, or 1018), and vice versa. For blockchain work the numbers are up to 256 bits, so the converter must use arbitrary-precision integers and also show the 32-byte zero-padded word and the signed (int256) reading that the EVM uses.
Handy values
| Decimal | Hex | Meaning |
|---|---|---|
| 1,000,000 | 0xf4240 | 1 USDT / USDC (6 decimals) |
| 1,000,000,000 | 0x3b9aca00 | 1 gwei in wei; 1 SOL in lamports |
| 1018 | 0xde0b6b3a7640000 | 1 ether in wei |
| 264 − 1 | 0xffffffffffffffff | uint64 max |
| 2128 − 1 | 0xffff…ffff (32 f) | uint128 max |
| 2256 − 1 | 0xffff…ffff (64 f) | uint256 max, the "unlimited" approve amount |
Worked example
A storage slot read returns 0x00000000000000000000000000000000000000000000000000000000000f4240. Stripping the leading zeros leaves 0xf4240 = 15×164 + 4×163 + 2×162 + 4×16 + 0 = 983,040 + 16,384 + 512 + 64 = 1,000,000, which is 1 USDT in 6-decimal units. A word of 64 f characters is 2256 − 1 as a uint256 but −1 as an int256, which is how a contract stores negative one.
Common mistakes
- Reading a decimal string as hex.
1000000is one million in decimal but 16,777,216 in hex. The page treats digit-only input as decimal unless you add0x. - Losing precision in a spreadsheet. Values above 253 (about 9 × 1015) are rounded by double-precision floats; wei and 18-decimal token amounts exceed that.
- Forgetting the sign. A word whose first hex digit is 8 or higher has its top bit set and may represent a negative int256 rather than a huge uint256.
- Odd-length hex.
0xabcis a valid number but not a whole number of bytes; it occupies 2 bytes once the leading nibble is padded.
Typical workflow
- Copy a word from the calldata breakdown in the ABI decoder or from a storage slot in a block explorer.
- Paste it here to read it as a decimal amount; then divide by the token's decimals with the token decimals converter or the Ethereum unit converter.
- If the value looks like 0xffff…, check the int256 row: it may be a negative number or an "infinite" allowance.