A gas fee is what you pay the network to process a transaction. Every transfer, swap or contract interaction uses computing work on the blockchain, and the fee pays the validators or miners for that work. On networks such as Ethereum the fee is called gas. The word is a unit of work, and the fee is the amount of work multiplied by the price of each unit, so the total varies with demand.
Gas fees surprise many newcomers. A transfer that costs almost nothing on one network can cost several dollars on another in a busy period. This guide explains how the fee is calculated, why it changes, and how to estimate the cost before you send.
How the fee is calculated
On Ethereum, the fee has two parts: the amount of gas the transaction uses, and the gas price, which is what you pay for each unit of gas.
Fee = gas used × gas price
Gas price is quoted in gwei, a small unit of ether. One gwei is one billionth of an ether. A simple transfer of ether uses 21,000 units of gas. A more complex contract interaction can use far more.
A worked example
Suppose you send ether to a friend, and the gas price is 20 gwei.
Fee = 21,000 × 20 gwei = 420,000 gwei = 0.00042 ether
The fee is 0.00042 ether in total. If ether is worth 3,000, that is about 1.26 dollars. If the gas price doubles to 40 gwei because the network is busy, the same transfer costs about 2.52 dollars. Nothing about the transfer changed, but the fee did.
| Gas price | Fee for a 21,000-gas transfer | Value at 3,000 per ether |
|---|---|---|
| 20 gwei | 0.00042 ether | about 1.26 |
| 40 gwei | 0.00084 ether | about 2.52 |
| 100 gwei | 0.0021 ether | about 6.30 |
The figures are an example. The gas price changes constantly, and the ether price moves too. Check the current values on your wallet before you send.
Why fees rise and fall
Blocks have limited space, so when many people want to transact at once, they compete to have their transactions included. Users who want faster inclusion offer a higher gas price, and the price rises until demand eases. When the network is quiet, fees fall.
Demand rises with popular events, token launches, market volatility and automated activity. A single busy application can push up fees for everyone on the network. Fees also depend on the complexity of the transaction, because more complex operations use more gas.
Networks and fees
Different blockchains price their fees differently. Some have very low fees most of the time, others have higher fees and more predictable costs. Layer-2 networks are built on top of a main chain and batch many transactions together, which lowers the cost per transfer. They still rely on the main chain for security, and moving coins between layers adds its own steps and fees.
When you compare networks, compare the total cost of your transaction, including any bridging or swap fees, and check how reliable the network is during busy periods.
Estimating the cost before you send
- Check the current gas price on your wallet or a reliable explorer.
- Estimate the gas the transaction will use. A plain transfer is a known amount, and a contract interaction is usually shown by the wallet before you confirm.
- Multiply the two to get the fee in the network's native coin.
- Convert to your own currency at the current price.
- Add any platform fees, such as the spread on a swap.
Many wallets show the estimate before you confirm. Read it, and check whether the fee is shown in the coin or in dollars.
Swaps and contract calls cost more than transfers
A plain transfer of the network's own coin is the cheapest thing you can do, because it uses a fixed and small amount of work. Swapping one token for another, depositing into a lending pool or interacting with a decentralised application runs more instructions, and so it uses more gas. The same network can charge a few cents for a transfer and several dollars for a swap, at the same gas price, because the work is different.
For this reason, judge a fee by the action, not by the network's headline price. Before you confirm, read what the transaction will do. A swap may need an approval first, which is a separate transaction with its own fee. Many people pay for two or three transactions when they think they are making one.
Base fees and priority fees
On Ethereum, since a major upgrade in 2021, the fee has two parts. A base fee is set by the protocol according to how full the recent blocks were, and it is removed from circulation, or burned, rather than paid to validators. A priority fee, or tip, is an extra amount paid to the validator to encourage them to include your transaction first.
A wallet usually suggests a base fee plus a tip. Setting the tip very high makes a transaction faster, but it does not change the base fee. When the network is quiet, a small tip is often enough. When it is busy, a larger tip helps, but it costs more, and it does not guarantee a place if the base fee rises further.
Timing and patience
Demand on busy networks follows patterns. Activity can spike around a popular launch, a market move or a large event, and it can fall in quiet hours. If a transaction is not urgent, waiting for a quieter period can cut the fee substantially. Some wallets and explorers show recent fee history, which helps you see whether the current price is high or normal.
Patience has limits. A transaction sent with a very low fee may wait a long time, or fail if the network's fee moves above what you set. For urgent transactions, pay the current rate. For non-urgent ones, check the history and wait.
Mistakes that cost money
Sending during a spike. If you can wait, a quieter period is often cheaper.
Setting the gas price too low. A transaction can get stuck or take a long time to confirm, and some wallets let you speed it up, which costs more.
Paying for failed transactions. On many networks, a transaction that fails still uses gas. Check the contract and the amounts before you confirm.
Forgetting the network coin. To pay a fee you need some of the network's own coin. Sending a token without that coin in your wallet can leave the transfer stuck.
Approving unknown contracts. Some scams drain wallets through approvals that cost gas and give away control. The guide on crypto scams covers the common forms.
Key takeaways
A gas fee pays the network for processing a transaction. On Ethereum it is the gas used multiplied by the gas price, quoted in gwei. Fees rise when many people want to transact at once and fall when the network is quiet. Layer-2 networks lower the cost by batching transactions, and they bring their own steps and fees. Estimate the fee before you send, keep some of the network's coin in your wallet, and check what a contract will do before you confirm.
This guide is for general information, not financial advice. See the disclaimer.