How Ethereum Gas Fees Are Actually Calculated
Two numbers multiplied together, one of which you do not control. The full formula, including the parts wallets hide.
The fee for an Ethereum transaction is the product of two figures. Everything else is detail about how those two are determined.
The formula
fee = gas used x (base fee + priority fee)
Gas used measures computational work. A plain transfer of ETH consumes 21,000 gas, which is fixed by the protocol. A token transfer typically consumes 45,000 to 70,000. A swap through a decentralised exchange commonly runs 120,000 to 250,000, depending on how many contracts it touches.
Base fee is set by the protocol, not by you or your wallet. It rises when blocks are more than half full and falls when they are less than half full, adjusting by up to 12.5 percent per block. It is burned rather than paid to anyone.
Priority fee is the tip you add to be included sooner. This goes to the validator.
What this means in practice
| Operation | Typical gas used |
|---|---|
| ETH transfer | 21,000 |
| ERC-20 token transfer | 45,000 to 70,000 |
| Token approval | 45,000 to 55,000 |
| Simple DEX swap | 120,000 to 180,000 |
| Multi-hop swap | 200,000 to 350,000 |
| NFT mint | 80,000 to 200,000 |
Multiply any of these by the current base fee plus tip, then by the ETH price, to get a figure in your own currency. That is the whole calculation.
The part that surprises people
The value you are sending does not appear anywhere in the formula. Moving $10 and moving $10 million cost exactly the same, because the network performs identical work.
This is the single most common misunderstanding about network fees, and it follows directly from the design.
What EIP-1559 changed
Before August 2021, users submitted a single gas price and competed in a blind auction. Overpaying was common because nobody knew what the clearing price would be.
The 2021 upgrade split the fee in two. The protocol now sets a base fee algorithmically from recent block fullness, and users add a tip on top. Two consequences follow.
You cannot pay less than the base fee. It is a floor, not a suggestion. A transaction offering less will not be included.
Fee estimation became more accurate. Because the base fee for the next block is deterministic from the current one, wallets can predict cost far better than they could under the old auction.
The base fee being burned also means a portion of every transaction fee permanently reduces ETH supply, which is a monetary effect rather than a fee mechanic and is frequently conflated with one.
Gas limit versus gas used
Your wallet sets a gas limit, which is the maximum you authorise. You pay only for gas actually used, except in one case.
If the transaction runs out of gas before completing, it fails and you pay for everything consumed up to that point. You get nothing and the fee is not refunded. This is why a failed transaction still costs money.
Wallets estimate the limit automatically and add a margin. Manual reduction to save money is a false economy that produces exactly this failure.
Where to check current values
Any block explorer displays the current base fee and recent block fullness. Several publish a gas tracker with estimated costs for common operations at different priority levels.
For a figure you can act on, check the base fee at the moment you intend to transact rather than reading an article about what it was. It moves within minutes, and venues that quote network fees separately, such as venues that quote the network fee separately, make it possible to see the network cost apart from the platform’s own charge.
Fees move with network demand. Any figure here reflects the date shown above and should be re-checked before you act on it. Where a measurement was taken by hand, the article says so.
Related reports
- A Year of Fee Data: What We Learnedgas mechanics
- Batching: The Simplest Way to Cut On-Chain Costsgas mechanics
- Priority Fees, Block Building and Where Your Tip Goesgas mechanics