Converters

Token Decimals Converter (Raw Value โ†” Amount)

Token contracts never store "1.5 USDT". They store an integer โ€” 1500000 โ€” and a decimals value that says where the decimal point goes. Raw values show up in transaction input data, event logs, API responses and smart contract calls. Paste a raw value or a hex word to get the human amount, or type an amount to get the exact integer a contract expects.

Result
1.5
Hex (for calldata)
0x16e360

Smart contracts store balances as whole numbers. A token's decimals field says where to put the point: 1,500,000 raw USDT (6 decimals) is 1.5 USDT, while 1,500,000 raw of an 18-decimal token is 0.0000000000015. Read the decimals from the token contract on an explorer before trusting a conversion. BEP-20 USDT on BNB Chain uses 18 decimals, not 6.

How decimals work

The ERC-20 standard defines decimals as a display hint: the amount a user sees equals the raw balance divided by 10^decimals. The same idea exists on TRON (TRC-20), BNB Smart Chain (BEP-20), Solana SPL tokens (the mint's decimals) and native units such as wei, lamports or piconero. The converter works with BigInt, so 78-digit uint256 values are exact.

amount = raw รท 10^decimals raw = amount ร— 10^decimals (must be a whole number) 0x0f4240 = 1,000,000 raw = 1 USDT (6 decimals)

Common decimals

  • 6 โ€” USDT on Ethereum and TRON, USDC on most networks, USDT and USDC on Solana.
  • 18 โ€” ETH in wei, DAI, most ERC-20 tokens, BNB, and USDT/USDC as issued on BNB Smart Chain.
  • 8 โ€” WBTC and other Bitcoin-pegged tokens, matching satoshis.
  • 9 โ€” SOL in lamports, SUI in MIST.
  • 12 โ€” Monero in piconero.

The same ticker can have different decimals on different networks. A raw 1,000,000 is 1 USDT on Ethereum but 0.000000000001 USDT on BNB Smart Chain. Always read decimals() of the exact contract on an explorer.

Where raw values come from

Explorers show raw values in the input data of a call (the last 32-byte word of a transfer is the amount in hex), in event logs and in the "Read contract" tab. Wallet developers and API users deal with them all the time. If you are checking an approval, an amount of 2ยฒโตโถ โˆ’ 1 (a hex word full of f) means unlimited allowance.

Frequently asked questions

+How many decimals does USDT have?

6 on Ethereum, TRON and Solana. The BEP-20 USDT contract on BNB Smart Chain uses 18.

+What is 1000000000000000000 wei?

1 ETH: 10ยนโธ wei with 18 decimals.

+Why does the converter reject my amount?

It has more decimal places than the token supports. A 6-decimal token cannot represent 0.0000001.

+How do I read an amount from transaction input data?

Take the 64-hex-character word for the amount, prefix it with 0x and paste it here with the token's decimals.

Calculations run entirely in your browser; nothing you type is sent to KOT.CASH. Results are estimates for information only and are not financial, tax or legal advice.

โ† All 92 crypto tools

Token Decimals Converter: Raw uint256 to Token Amount