In this track: Digital value and units
beginner · 3 MIN READ

Add and subtract exact ETH amounts

Convert to a common whole unit before combining amounts.

LET’S PICTURE IT

Adding centimetres to metres without conversion gives the wrong total. Using one common unit keeps the calculation clear.

SEE IT FOR YOURSELF
The same native ether amount shown as ETH, Gwei and WeiETH1× 1 billionGWEI1000000000× 1 billionWEI1000000000000000000

1 ETH = 1000000000 Gwei = 1000000000000000000 Wei.

Same value · different units · native ether only

Choose a common scale

Suppose Maya has 0.1 ETH and receives 0.2 ETH. Parse each input into Wei: 100000000000000000 and 200000000000000000. Add these exact integers, then format 300000000000000000 Wei as 0.3 ETH.

Subtraction needs a balance check

If a calculation subtracts more than the available amount, decide how the application should handle it. Native balances cannot simply become negative. An unsigned contract calculation can revert on underflow under ordinary checked arithmetic.

Account for fees separately

An ETH payment may require both its value and a fee budget. Having exactly the payment amount is not necessarily enough to send it. A fee estimate is not a guarantee, so an interface must explain what its spendable-balance calculation assumes.

Different assets do not add directly

One ETH plus one token is not two ETH. Even two ERC-20 balances with identical symbols may belong to different contracts. Keep network, asset identity and raw scale attached to every amount you combine.

TURN UNDERSTANDING INTO PRACTICEOpen the Wei / Gwei / ETH →
QUICK CHECK · NO PRESSURE

What is the safe first step when adding displayed ETH amounts?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.