Skip to the article
Token Trail

News from across crypto

Token decimals: how to read a trade amount

Token decimals set how a token’s smallest units appear as a readable balance; learn to convert raw amounts and check what a swap screen is showing.

By The Token Trail Desk3 min read

Token decimals: how to read a trade amount

Token decimals tell you how many tiny units make up one whole token, so you can read a balance or trade amount correctly. A token with 6 decimals has one million base units—the smallest units recorded by the token—for every whole token. A screen may show “1.25,” while the underlying amount is stored as the integer 1,250,000.

This setting changes how an amount is displayed, not what the token is worth. It also does not change the supply or make a token easier to trade. For context on a Solana swap, see how Byreal handles swaps and liquidity. The same decimal rule applies whether a token is held in a wallet or sent through a swap.

How do token decimals work?

To convert a raw amount into whole tokens, divide by 10 raised to the token’s decimal count. With 6 decimals, 1,250,000 raw units becomes 1.25 tokens. To convert the other way, multiply the readable amount by one million.

The count is part of a token’s setup. On Solana, it is recorded in the token’s mint, the account that defines a token. Other token systems also set decimal precision. Once set, the count tells wallets and apps where to place the decimal point when they display balances.

How do decimals affect a trade amount?

A trade screen usually shows readable amounts, but the transaction uses whole base units. The app converts between the two when it builds the trade. That means “0.5 token” can be sent as an integer amount even though the user sees a fraction.

Check both sides of a trade before approving it: the token you send, the token you expect to receive, and the number of digits shown. If an app rounds a small balance or quote, the displayed value may hide tiny leftover units. A quote can also change with the token price or available liquidity; decimals only describe the unit size.

  • 6 decimals: 1 whole token equals 1,000,000 base units.
  • 9 decimals: 1 whole token equals 1,000,000,000 base units.
  • 0 decimals: amounts are whole units, with no fractional token amount.
  • More decimals mean finer unit steps, not a higher token value.

How can you check token decimals?

For a trade, first confirm the token’s network and full token address. Similar names and symbols can refer to different tokens, and their decimal settings may differ. Then compare the amount shown by the wallet or swap app with the token’s recorded decimals. A balance API may return both the raw integer and a human-readable amount; use the decimals value to convert if it gives only the raw amount.

Do not guess the decimal count from a ticker or copy a raw amount between apps without checking what each field expects. For most readers, the useful rule is simple: read the app’s token amount as displayed, and treat raw integers as machine units that need the token’s decimal count to make sense.