Token Unit Converter
Convert between human-readable token amounts and raw values for any ERC-20 token. Supports custom decimals for USDC, WBTC, ETH, and more.
Common Token Decimals
| Token | Symbol | Decimals |
|---|---|---|
| Ether | ETH | 18 |
| USD Coin | USDC | 6 |
| Tether | USDT | 6 |
| Wrapped Bitcoin | WBTC | 8 |
| Dai | DAI | 18 |
| Chainlink | LINK | 18 |
| Uniswap | UNI | 18 |
| Aave | AAVE | 18 |
| SUI | SUI | 9 |
| Shiba Inu | SHIB | 18 |
How to Use This Token Unit Converter
This tool converts between human-readable token amounts and their raw uint256 values for any ERC-20 token. It supports all decimal configurations from 0 to 18 and beyond.
- Select or enter the token decimals — choose a preset (18 for ETH/DAI, 6 for USDC/USDT, 8 for WBTC) or enter a custom decimal value.
- Enter a human-readable amount (e.g., 1.5) to see the raw uint256 value, or enter a raw value to see the human-readable equivalent.
- View the conversion — the tool shows both representations instantly, handling arbitrary precision without rounding errors.
- Copy the result for use in smart contract calls, test scripts, or transaction parameters.
All conversions run locally in your browser with arbitrary precision arithmetic. No data is sent to any server.
Common Use Cases
- Smart contract parameters — Convert human-readable token amounts to raw uint256 values for function call arguments like transfer amounts and allowances.
- Event log interpretation — Convert raw uint256 values from Transfer and Approval events into human-readable token amounts.
- DeFi development — Calculate precise token amounts for swap parameters, liquidity amounts, and fee calculations across tokens with different decimals.
- Testing and debugging — Quickly convert between display amounts and raw values when writing tests or debugging token-related smart contract logic.
- Cross-token calculations — Compare amounts across tokens with different decimal configurations (e.g., USDC with 6 decimals vs DAI with 18 decimals).
Related Tools
Frequently Asked Questions
What are ERC-20 token decimals?
ERC-20 token decimals define how many decimal places a token supports. Since the EVM only works with integers, decimals are a display convention. A token with 18 decimals stores 1.0 tokens as 1000000000000000000 (10^18) in its raw uint256 form. Common values: 18 (ETH, DAI, LINK), 6 (USDC, USDT), 8 (WBTC).
How do I convert raw token values to human-readable amounts?
Divide the raw uint256 value by 10^decimals. For example, a USDC balance of 1500000 (6 decimals) equals 1.5 USDC (1500000 / 10^6). For ETH with 18 decimals, 2500000000000000000 equals 2.5 ETH. In code, use ethers.js formatUnits() or viem's formatUnits() to avoid floating-point errors.
Why do different tokens have different decimals?
Token creators choose decimals based on the token's use case and precision requirements. ETH and most DeFi tokens use 18 decimals for maximum precision. Stablecoins like USDC and USDT use 6 decimals to mirror traditional currency precision. WBTC uses 8 decimals to match Bitcoin's satoshi subdivision.
What happens if I use the wrong decimals?
Using incorrect decimals can result in sending the wrong amount of tokens. For example, if you enter a USDC amount assuming 18 decimals instead of 6, the actual value will be 10^12 times larger than intended. Always verify the token's decimals by checking the contract's decimals() function before making transfers.
Can a token have 0 decimals?
Yes. Some tokens have 0 decimals, meaning each unit is indivisible. This is common for NFT-like fungible tokens, governance tokens where fractional voting is not desired, or tokens representing whole items. With 0 decimals, the raw value and the display value are identical.
Related Tools & Guides
ETH Unit Converter
Convert between Ethereum units: Wei, Gwei, and ETH. Essential for gas and transaction calculations.
Hex / Decimal Converter
Convert between hexadecimal and decimal numbers. Useful for Ethereum block numbers, values, and calldata.
ERC-20 Token Info Decoder
Decode ERC-20 token function calls and event logs from raw transaction data.
Try Also
Unix Timestamp Converter
Convert between Unix timestamps and human-readable dates. Includes notable Ethereum timestamps and relative time display.
ABI Encoder / Decoder
Encode and decode Ethereum ABI data. Input function signatures and parameters to generate calldata.
Gas Fee Calculator
Calculate Ethereum transaction costs from gas limit and gas price. Estimate fees in ETH and USD.