How to convert nanotons to GRAM
The rule is one division: GRAM = nanotons ÷ 1,000,000,000. In other words, move the decimal point nine places to the left. To go back, multiply by a billion.
- 1 GRAM = 1,000,000,000 nanotons
- 0.5 GRAM = 500,000,000 nanotons
- 0.01 GRAM = 10,000,000 nanotons
- 0.000000001 GRAM = 1 nanoton
So when an API answers that a wallet's balance is 2500000000, the wallet holds 2.5 GRAM. A fee of 5,000,000 nanotons in a hypothetical transaction is 0.005 GRAM.
Why not just use decimals? Blockchains count money in whole numbers, because whole numbers add up exactly on every node, while fractions in computers round. The nanoton is the whole number behind every GRAM amount; wallets divide by a billion only to show it to you.
The name comes from the coin's old name, Toncoin. Since the rename to GRAM, the TON documentation also calls the same unit a nanogram. It is the same thing: one billionth of a coin.
Where you meet nanotons
- APIs and explorers. Balances, transfer values and fees in raw blockchain data are in nanotons.
- Fees in the network config. Flat gas prices, message prices and the limits at which an account that owes storage rent is frozen are all stored in nanotons.
- Wallet links and dapps. A ton://transfer link takes its amount in nanotons, and a dapp that asks your wallet to sign a transaction through TON Connect also states the amount in nanotons. Your wallet shows it in GRAM before you confirm, so check that the figure matches what you expect to pay.
- Code. Developer libraries have helpers such as toNano("1.5"), which turns 1.5 GRAM into 1500000000.
A wrong number of zeros is a classic and expensive mistake: an amount meant in nanotons but read as GRAM is a billion times larger.
Nanotons and jetton decimals
Tokens on TON have their own smallest units. Every Jetton declares its decimals in its metadata. Most use 9, like GRAM, so their smallest unit is also a billionth. USD₮ uses 6, so 1 USD₮ is 1,000,000 of its units, not a billion.
Mixing the two up moves the decimal point by three places. Wallets apply each token's decimals for you; anyone writing a script or reading raw API data has to apply them before trusting an amount.
How DYOR converts nanotons
The unit converter turns GRAM into nanotons and dollars and back as you type. GRAM and nanotons convert to the last digit; dollars use the GRAM price DYOR shows across the site and are rounded to the cent. It runs in your browser.
The network config page shows TON's fee parameters as the network stores them. Flat amounts, such as the flat gas price and the lump price of a message, are in nanotons. The per-unit prices (gas, bits, cells and storage per second) are in nanotons multiplied by 65,536, exactly as the network keeps them.