Convert & calculate · Hex to decimal
Number converter
Move a number between decimal, hexadecimal and binary.
The number
Type it once. Every other form appears beside it as you go.
Paste from a block explorer, a log, or a calculator. Spaces and commas are ignored.
Leave this on automatic unless your number has no 0x or 0b in front of it.
Nothing to convert yet
Type a number on the left and its decimal, hexadecimal and binary forms all appear here at once.
Numbers you'll meet a lot
Handy for sanity-checking a value you pulled out of a transaction.
| Decimal | Hexadecimal | What it is |
|---|---|---|
| 255 | 0xff | The largest single byte |
| 21,000 | 0x5208 | Gas used by a plain ETH transfer |
| 1,000,000,000 | 0x3b9aca00 | Wei in one gwei |
| 1,000,000,000,000,000,000 | 0xde0b6b3a7640000 | Wei in one ether |
About this tool
Hexadecimal is base 16, the way Ethereum writes addresses, hashes, calldata and JSON-RPC numbers. This number converter shows a whole number in decimal, hexadecimal and binary side by side as you type. It uses arbitrary-precision BigInt math, so full 256-bit values such as the uint256 maximum convert exactly. A 0x or 0b prefix is detected automatically, and spaces and commas are ignored.
Common questions
How do I convert hex to decimal?
Paste the value with its 0x prefix and the decimal form appears beside it. Without a prefix, set Read it as to hexadecimal, because a value such as 10 is otherwise read as decimal.
Why does Ethereum use hex?
Every byte is exactly two hex digits, so hex maps cleanly onto the raw bytes that contracts and transactions store. JSON-RPC also returns numbers such as balances and block numbers as hex strings.