EVMTools

Hex / Decimal Converter

Convert between hexadecimal and decimal numbers. Useful for Ethereum block numbers, values, and calldata.

Hex to Decimal

Decimal to Hex

Common Ethereum Values

Block numbers, nonces, and values in Ethereum JSON-RPC are returned as hex.

Example: 0x1e8480 = 2,000,000 (gas limit)

How to Use This Hex / Decimal Converter

This free online converter instantly translates between hexadecimal and decimal number formats. It is essential for Ethereum developers who need to interpret block numbers, gas values, token amounts, and raw calldata.

  1. Enter a hex value (with or without the 0x prefix) to convert it to its decimal equivalent.
  2. Enter a decimal number to convert it to hexadecimal format with the 0x prefix.
  3. Copy the result using the copy button and use it in your code, RPC calls, or block explorer queries.

The converter supports arbitrarily large numbers including full uint256 values. Everything runs locally in your browser with no data sent to any server.

Common Use Cases

  • Block number conversion — Convert hex block numbers from JSON-RPC responses (e.g., 0x1234AB) to human-readable decimal format.
  • Gas and Wei values — Translate hex gas prices, gas limits, and Wei amounts from transaction receipts into decimal for analysis.
  • Calldata inspection — Convert hex values embedded in calldata parameters to understand numeric arguments passed to smart contracts.
  • Token amounts — Decode hex-encoded token transfer amounts from event logs and transaction data.
  • Storage slot values — Interpret raw storage slot reads from eth_getStorageAt which return values in hex.

Related Tools

Frequently Asked Questions

Why does Ethereum use hexadecimal numbers?

Ethereum uses hexadecimal (base-16) because it maps directly to binary data at the byte level. Each hex digit represents exactly 4 bits, making it compact and easy to read raw blockchain data. Block numbers, transaction values, gas limits, and calldata are all represented in hex in JSON-RPC responses and on block explorers.

How do I convert a hex number to decimal?

To convert hex to decimal, each digit is multiplied by 16 raised to its positional power. For example, 0xFF = 15 x 16^1 + 15 x 16^0 = 255. This tool handles the conversion instantly for numbers of any size, including large uint256 values used in Ethereum.

What is the 0x prefix in Ethereum?

The 0x prefix indicates that the following characters are a hexadecimal number. It is a convention used across all EVM chains to distinguish hex values from decimal. For example, 0x10 is hex for 16 in decimal, not the number ten. Most Ethereum tools and libraries require the 0x prefix for hex inputs.

How do I convert Wei to Ether using hex?

First convert the hex Wei value to decimal, then divide by 10^18. For example, 0xDE0B6B3A7640000 converts to 1,000,000,000,000,000,000 Wei, which equals 1 ETH. This tool handles the hex-to-decimal step, and you can then use a Wei converter for the unit conversion.

What is the maximum value of a uint256 in hex?

The maximum uint256 value is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (64 hex digits), which equals 2^256 - 1 in decimal. This is approximately 1.16 x 10^77. This tool can convert the full range of uint256 values between hex and decimal.