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.
- Enter a hex value (with or without the 0x prefix) to convert it to its decimal equivalent.
- Enter a decimal number to convert it to hexadecimal format with the 0x prefix.
- 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
UTF-8 / Hex / Bytes Converter
Convert between UTF-8 text, hex strings, and byte arrays for encoding and debugging Ethereum data.
Bytes32 / String Converter
Convert between bytes32 hex, UTF-8 strings, numbers, and addresses with padding visualization.
Base64 Encoder / Decoder
Encode and decode Base64 strings with support for text and hex input modes.
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.
Related Tools & Guides
ABI Encoder / Decoder
Encode and decode Ethereum ABI data. Input function signatures and parameters to generate calldata.
ETH Unit Converter
Convert between Ethereum units: Wei, Gwei, and ETH. Essential for gas and transaction calculations.
UTF-8 / Hex / Bytes Converter
Convert between UTF-8 text, hexadecimal strings, and byte arrays. Essential for encoding and debugging Ethereum data.
Try Also
Keccak256 Hash Generator
Generate Keccak256 hashes from text input. The hash function used by Ethereum and Solidity.
Gas Fee Calculator
Calculate Ethereum transaction costs from gas limit and gas price. Estimate fees in ETH and USD.
Unix Timestamp Converter
Convert between Unix timestamps and human-readable dates. Includes notable Ethereum timestamps and relative time display.