GALAXY OF TOOLS

CRYPTO SECTOR

Token Unit Converter

Convert raw base units to human token amounts and back for any decimals: USDC 6, WBTC 8, SOL 9, ETH 18.

0–77. Read it from the token contract’s decimals().
—
Human amount
—
Base units (decimal)
—
Base units (hex)
—
uint256 word (32 bytes)
—
Fits in uint256?
—

Informational only, not investment advice. Amounts are converted exactly with integer arithmetic; always confirm a token’s decimals from its contract before sending.

Runs entirely in your browser. Nothing you enter or upload is sent to a server.

Token unit converter for any number of decimals

Every on-chain token balance is stored as a whole number of base units. ETH has 18 decimals, so 1 ETH is 1,000,000,000,000,000,000 wei; USDC has 6, so 1 USDC is 1,000,000 base units; Solana counts lamports at 9 decimals and Bitcoin satoshis at 8. This token unit converter turns a raw integer from a contract call, explorer or RPC response into the human amount, and converts a human amount back into the exact integer a transaction needs.

It accepts decimal or 0x hexadecimal input (the form you see in raw calldata and eth_call results), shows the value as a 32-byte uint256 word, and checks that the number fits in 256 bits. All arithmetic uses JavaScript BigInt, so there is no rounding at any size.

The conversion is pure arithmetic, done in your browser with no network calls. It is informational only and not investment advice.

How to use the Token Unit Converter

  1. Choose a direction: Base units → amount to read a raw integer, or Amount → base units to prepare a value for a transaction.
  2. Pick a Token preset (USDC 6, ETH 18, WBTC 8, SOL 9 and others) or choose Custom and type the Decimals yourself.
  3. Enter the value. In base-unit mode you can paste decimal digits or 0x hex straight from an explorer.
  4. Read the result, the hex form and the padded 32-byte word, then use Copy base units, Copy amount or Copy hex.
  5. Switch direction at any time — the current value carries over so you can check a round trip.

Token Unit Converter features

Any decimals from 0 to 77

Presets for the common tokens plus a custom field for anything else, including 0-decimal NFTs and 12-decimal Monero.

Hex and decimal input

Paste 0xde0b6b3a7640000 or 1000000000000000000; both mean 1 ETH.

Exact BigInt maths

No floating point anywhere, so 30-digit balances convert without losing their last digits.

uint256 word

The value padded to 64 hex characters, ready to splice into calldata, with a check that it fits in 256 bits.

Too-fine detection

Entering 0.0000001 for a 6-decimal token is flagged, because it cannot be represented on chain.

Decimals of common tokens

Decimals are a property of each token contract, not of the chain. Two tokens on the same network can differ, and the same stablecoin can have different decimals on different chains, so always check the contract’s decimals() value.

TokenDecimals1 token in base unitsBase unit name
ETH, most ERC-20s (DAI, LINK, UNI)181,000,000,000,000,000,000wei
USDC, USDT (Ethereum)61,000,000—
WBTC8100,000,000—
BTC8100,000,000satoshi
SOL91,000,000,000lamport
DOT1010,000,000,000planck
ATOM61,000,000uatom
XMR121,000,000,000,000piconero
ERC-721 NFT01—

parseUnits and formatUnits by hand

Libraries call the two directions parseUnits (human → base) and formatUnits (base → human). The rule is simple: move the decimal point decimals places. 2.5 USDC with 6 decimals is 2.5 × 106 = 2,500,000 base units, which is 0x2625a0 in hex and, padded to 32 bytes, the word 000…02625a0 you would see in a transfer call. Going the other way, 1,500,000 base units at 6 decimals is 1.5.

The trap is precision. A 64-bit floating-point number holds about 15–16 significant digits, so a balance like 123,456,789,012,345,678,901,234,567,890 wei cannot survive Number(value) / 1e18. This converter never touches floats — it works on the decimal string and an arbitrary-precision integer, the same approach as ethers.js and viem.

Related tools

For Ethereum’s named denominations (gwei, finney, szabo) and gas fee maths use the gwei to ETH converter; for Bitcoin fee rates, the satoshi to BTC converter. To decode an entire transfer(address,uint256) call rather than one number, paste it into the contract ABI decoder, and for plain base conversion of other integers there is the number base converter.

Token Unit Converter FAQ

What are token base units?

The smallest indivisible amount of a token. Contracts store and transfer only whole base units; the decimals value tells wallets where to put the decimal point for display.

How do I convert wei to a token amount?

Divide by 10 to the power of the token’s decimals. For an 18-decimal token, 1,500,000,000,000,000,000 wei ÷ 1018 = 1.5 tokens. This token unit converter does the division exactly.

Why does the converter reject 0.0000001 USDC?

USDC has 6 decimals, so the smallest amount is 0.000001. A value with seven decimal places is not a whole number of base units and no transaction could carry it.

Can I paste a hex value from a block explorer?

Yes. In base-unit mode anything starting with 0x is read as hexadecimal, including the 64-character padded words found in calldata and event logs.

What is the largest value it supports?

Any size, but it tells you whether the number fits in uint256 (2256 − 1), the limit for EVM token balances.

Is anything sent to a server?

No. The arithmetic runs in your browser; the page makes no network requests.

You might also need