Hex ↔ Decimal Converter for Big Numbers

Paste a 0x value from calldata, a storage slot or an RPC response and get its decimal form, or go the other way. Arbitrary precision, with the 32-byte word padding and signed interpretation that EVM work needs.

Accepts decimal, 0x hex, 0b binary, 0o octal, bare hex containing a–f, negative numbers, and underscores or commas as separators. Arbitrary size.

Computed in your browser with JavaScript. Addresses are never uploaded or stored.

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

DecimalHexMeaning
1,000,0000xf42401 USDT / USDC (6 decimals)
1,000,000,0000x3b9aca001 gwei in wei; 1 SOL in lamports
10180xde0b6b3a76400001 ether in wei
264 − 10xffffffffffffffffuint64 max
2128 − 10xffff…ffff (32 f)uint128 max
2256 − 10xffff…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

Typical workflow

  1. Copy a word from the calldata breakdown in the ABI decoder or from a storage slot in a block explorer.
  2. 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.
  3. If the value looks like 0xffff…, check the int256 row: it may be a negative number or an "infinite" allowance.

Frequently asked questions

Why not use a normal hex converter?

Most convert through 64-bit or floating-point numbers and silently lose digits above about 16 decimal places. EVM words are 256 bits, so a token balance such as 0xde0b6b3a7640000 (1018) already breaks them. This page uses arbitrary-precision integers.

What is the bytes32 row?

The value left-padded with zeros to 32 bytes (64 hex characters), which is how it appears as a word in calldata, return data, storage and event data.

How is int256 handled?

If an unsigned value has its top bit set (greater than 2255 − 1) the page also shows the negative number it represents in two's complement; for a negative input it shows the 32-byte word a contract would store.

Does it accept hex without 0x?

Yes, when the string contains at least one letter a–f. A string of only digits is read as decimal; add 0x to force hex.

How do I convert hex to decimal by hand?

Multiply each digit by 16 raised to its position from the right, starting at 0, and add them up: 0x2a = 2×16 + 10 = 42. Letters a–f stand for 10–15. For 64-digit values the arithmetic is tedious, which is what this page is for.

Why do Ethereum RPC responses use hex?

The JSON-RPC specification encodes all quantities as 0x-prefixed hex strings without leading zeros so that 256-bit values survive JSON parsers that only support 64-bit numbers. Block numbers, balances, gas and nonces all arrive this way.

What does the byte length tell me?

How many bytes the number needs without padding. Useful for checking whether a value fits a uint8, uint64, uint128, and whether an address-sized value (20 bytes) has been passed where a uint was expected.