UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

Free eBooks·About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeDeFi & TokenomicsToken Supply

Related Tools

Vesting PlannerImpermanent LossAPY/APR ConverterStaking Rewards

Token Supply & Decimals Calculator

Convert ERC-20 token amounts to the base-unit integer a contract call takes and back, and measure any holding against total supply. BigInt-exact.

You Might Also Like

All DeFi & Tokenomics

Vesting Planner

Turn an allocation, cliff and vesting period into a dated unlock schedule with a cumulative curve and CSV export. Handles both cliff conventions.

Impermanent Loss

Model the impermanent loss from a 50/50 liquidity pool as one token's price moves, entirely in your browser, with dollar amounts, not just percent.

APY/APR Converter

Convert APY to APR or APR to APY across 8 compounding frequencies. Shows the formula, result, and a full comparison table. Includes continuous compounding.

Staking Rewards

Project staked crypto growth over any period at a given APR, with simple or compounding payout. See total rewards, effective APY and a balance timeline.

An ERC-20 contract keeps every balance as a plain integer. The decimals() value on the contract is a display hint and nothing else: 1 USDC is stored as 1000000 because USDC reports 6 decimals, while 1 DAI is stored as 1000000000000000000 because DAI reports 18. Assume the wrong one and a transfer is off by a factor of a trillion.

This calculator does the two sums that sit around that number. It converts a human amount into the base-unit integer a contract call takes, and back again, and it measures a holding against a total supply as a percentage, in basis points, as a “1 in N” figure, and as the raw integer totalSupply() returns. Every value is computed with BigInt, so a supply with 78 digits stays exact.

Getting Your First Base-Unit Value

  1. Set Token decimals. The preset chips cover the common cases: 18 for ETH and most ERC-20s, 6 for USDC and USDT, 8 for WBTC, 9 for Solana SPL tokens, and 0 for a whole-unit token.
  2. In the first panel, type an amount. With the direction on Display amount → base units, entering the bundled sample of 2500.75 returns 2500750000000000000000, which is the integer transfer(), approve() or mint() expects.
  3. Press Swap to reverse the direction and turn a base-unit integer back into the amount a wallet shows.
  4. Fill Total supply and Amount held in the second panel to see the share figures. The sample’s 2,500.75 against a 1,000,000,000 supply works out to 0.000250075% of supply, or roughly 1 token in 399,880.
  5. Use the Copy button on any result box, including the raw totalSupply() integer.

How the Math Converts Amounts

  • Display to base units: the amount is split at the decimal point, the fractional part is right-padded with zeros to exactly decimals digits, and the two parts are concatenated into one integer. No multiplication by a float ever happens.
  • Base units to display: the integer is left-padded to at least decimals + 1 digits, then a point is placed decimals places from the right and trailing zeros are trimmed.
  • Share of supply: both amounts are taken to base units first, so the ratio is one integer divided by another. The percentage is produced by scaling the numerator by 1012 before dividing, which fixes the output at up to 12 fractional digits.

Precision: What Stays Exact and What Rounds

  • Base-unit conversion is lossless in both directions for any size of number, because it is string surgery on integers rather than arithmetic on doubles.
  • The percentage and basis-point figures are truncated, not rounded, at 12 fractional digits. For a holding of a few thousand tokens in a billion-token supply that is far more precision than the number is worth, but a dust holding in a large supply can show as 0.
  • Decimals must be a whole number from 0 to 36. Anything outside that range is refused, and a display amount with more fractional digits than the token allows is rejected with “18 decimals allow at most 18 fractional digits; this amount has 19.”
  • The base-units field only accepts a whole number. A value with a decimal point returns “Base units are a whole number, no decimal point, no sign.”
Display amount → base units
2500750000000000000000

This is the integer a transfer(), approve() or mint() call takes on-chain.

Share of total supply

Percent of supply

0.000250075%

Basis points

0.0250075 bps

Rarity

≈ 1 token in 399,880

Raw totalSupply()

1000000000000000000000000000

decimals is not stored per balance. It is one number on the contract that every tool multiplies by, so a token with 6 decimals holding “1000000” base units is showing 1.0, not a million. Every figure here is computed with BigInt in this tab, so a 78-digit supply stays exact.