What a Gas Fee Actually Is
A gas fee is what you pay to have a transaction processed on a blockchain like Ethereum. Every action on the network, whether it’s sending ETH, swapping tokens, or interacting with a smart contract, requires computational work from the network’s validators. Gas fees compensate them for that work and keep the network from being flooded with spam transactions.
Gas fees are paid in ETH, but priced in a smaller unit called gwei. One gwei equals one billionth of an ETH, which makes it far easier to express small fee amounts without a long string of decimals.
The Gas Fee Formula
Since Ethereum’s 2021 network upgrade (EIP-1559), the formula has two parts:
Gas Fee = Gas Units × (Base Fee + Priority Fee)
- Gas units — the amount of computational work your transaction needs. A simple ETH transfer needs about 21,000 units. A token swap on a DEX can need 100,000 to 200,000 units or more.
- Base fee — set automatically by the network based on how full recent blocks have been. This portion is burned (permanently removed from circulation), not paid to anyone.
- Priority fee (tip) — an optional amount you add to encourage validators to include your transaction sooner. This part goes to the validator.
A Worked Example
Say you’re sending 1 ETH to a friend:
- Gas units required: 21,000
- Current base fee: 10 gwei
- Your added tip: 2 gwei
- Total gas price: 12 gwei
Total fee = 21,000 × 12 gwei = 252,000 gwei = 0.000252 ETH
If ETH is trading at $2,500, that transaction costs roughly $0.63. Of that, the network burns the base-fee portion (210,000 gwei) and the validator receives the tip (42,000 gwei).
Why Gas Fees Spike
Each block can only process a limited amount of computational work. When demand for block space outpaces that limit, such as during a popular NFT mint or a major DeFi launch, the base fee rises sharply to ration access, and users start adding larger tips to compete for inclusion. This is sometimes called a “gas war.” During the 2021 NFT boom, gas prices regularly spiked above 200 to 500 gwei, turning a routine transfer into a $50-plus expense.
What Affects Your Gas Fee
| Transaction Type | Typical Gas Units |
|---|---|
| Simple ETH transfer | ~21,000 |
| ERC-20 token transfer | 45,000–65,000 |
| DEX swap (e.g. Uniswap) | 100,000–200,000 |
| Deploying a smart contract | 100,000+ |
More complex operations always cost more gas, regardless of network congestion, because they require more computational work no matter when you submit them.
How to Reduce What You Pay
- Time your transactions. Network activity typically peaks during US business hours. Transacting during off-peak hours (often nights and weekends UK time) can meaningfully lower the base fee you’re paying.
- Avoid transacting during hype events. Major NFT mints, token launches, and viral DeFi moments cause the sharpest spikes.
- Let your wallet estimate the fee. Most modern wallets, including MetaMask and Coinbase Wallet, automatically calculate a reasonable gas setting for you rather than requiring manual input.
- Consider a Layer-2 network. Networks like Arbitrum, Optimism, or Base process transactions with far lower fees than Ethereum’s main chain, while still settling back to Ethereum for security.
- Don’t set your tip unnecessarily high. A larger tip only speeds up inclusion during congestion; during quiet periods it adds cost with no real benefit.
Frequently Asked Questions
Why do I pay gas even if my transaction fails?
Because the computational work happens regardless of the outcome. Validators still have to process and attempt the transaction, so the fee is charged whether it succeeds or fails.
What is gwei?
Gwei is a small denomination of ETH used to price gas, equal to one billionth of an ETH. It’s used because gas prices are too small to express conveniently in whole ETH.
Do all blockchains use gas fees the same way?
No. Other chains (Solana, BNB Chain, Layer-2 networks) have their own fee structures, generally much lower than Ethereum’s main chain, though the underlying idea of paying for computational work is similar.
Can I set my own gas price?
Yes, most wallets allow manual gas settings, but setting it too low risks your transaction getting stuck pending for a long time, while setting it too high wastes money unnecessarily.
Conclusion
Gas fees aren’t random, they follow a clear formula: gas units used, multiplied by the base fee plus your tip. Understanding that formula is the difference between guessing at a “reasonable” fee and actually controlling what you pay. Time your transactions outside of peak demand, let your wallet’s estimate do the heavy lifting, and consider a Layer-2 network for frequent, smaller transactions.