Decimal to Hex Converter

EVM JSON-RPC parameters expect quantities as 0x-prefixed hexadecimal, not plain decimals. This converter turns a base-10 integer into the hex form an RPC call needs. It runs entirely in your browser with no key and no network request.

Enter a non-negative integer. Hex is prefixed 0x; parsing accepts values of any size.

Runs entirely in your browser. No API key, no data leaves this page.

Encoding parameters for RPC calls

When you call methods like eth_getBlockByNumber, the block number argument must be hex-encoded with a 0x prefix. Passing a decimal string will be rejected or misread. Convert 21000 to 0x5208, or a block height like 18500000 to its hex form, before placing it in the params array.

Gas and quantity fields

Gas limits, gas prices in wei, and transfer amounts are all quantity fields in the EVM RPC schema and must be hex. Encoding them correctly avoids off-by-one and format errors when constructing raw requests by hand.

Frequently asked

Will the output include the 0x prefix?

Yes. The result is emitted with a leading 0x so it can be dropped directly into a JSON-RPC params array.

Does this send my input over the network?

No. All conversion is local to your browser. There is no API call and no key required.

Related tools

Top up, get a key, ship.

Self-serve. Pay in crypto or card. Metered by credits — heavy primitives cost more, simple ones are cheap.

Get API key