Utilix knowledge base
How to Calculate Ethereum Gas Fees
Published May 3, 2026
Every Ethereum transaction requires a fee paid to validators. This fee, called a gas fee, depends on how much computational work the transaction requires and the current network demand. Here is how to calculate it.
The Gas Fee Formula
Fee (ETH) = Gas Units × Gas Price (Gwei) × 10⁻⁹
Fee (USD) = Fee (ETH) × ETH price (USD)
All three inputs are needed for the USD cost.
Gas Units: The Computational Work
Gas units (also called the gas limit) measure how much computation the transaction requires. Common values:
| Transaction type | Gas units |
|---|---|
| ETH transfer (plain) | 21,000 |
| ERC-20 token transfer | 60,000–80,000 |
| Uniswap token swap | 100,000–200,000 |
| NFT mint (simple) | 50,000–150,000 |
| Smart contract deployment | 500,000–2,000,000+ |
For a plain ETH transfer, the gas limit is always exactly 21,000 — no more, no less. Complex smart contracts may use millions of gas units.
Gas Price: The Market Rate
Gas price reflects supply and demand on the network. When more users are trying to get transactions included, they bid higher gas prices to incentivize validators.
Gas price is measured in Gwei (1 Gwei = 0.000000001 ETH). Historical ranges:
- Normal activity: 10–30 Gwei
- Moderate congestion: 30–100 Gwei
- Peak congestion (NFT launches, market events): 100–500+ Gwei
You can check the current gas price on gas trackers like Etherscan's Gas Tracker.
EIP-1559: Base Fee + Priority Fee
Since the London upgrade (2021), Ethereum uses EIP-1559 for gas pricing. Each block has:
- Base fee — Set algorithmically by the protocol. This portion is burned (not paid to validators).
- Priority fee (tip) — Paid to the validator to incentivize inclusion. Typically 1–3 Gwei for normal transactions.
Your effective gas price = base fee + priority fee.
When calculating fees, use the total effective gas price (base + tip).
Worked Examples
Example 1: ETH transfer
- Gas units: 21,000
- Gas price: 20 Gwei
- ETH price: $3,000
Fee = 21,000 × 20 × 10⁻⁹ = 0.00042 ETH
Fee (USD) = 0.00042 × $3,000 = $1.26
Example 2: Uniswap swap during moderate congestion
- Gas units: 150,000
- Gas price: 50 Gwei
- ETH price: $3,000
Fee = 150,000 × 50 × 10⁻⁹ = 0.0075 ETH
Fee (USD) = 0.0075 × $3,000 = $22.50
Tips for Reducing Gas Costs
- Transact during low-congestion periods. Gas prices are typically lower on weekends and late evenings (UTC). Many users interact with DeFi during business hours.
- Set a gas limit with margin. Under-estimating gas causes the transaction to fail (and you still pay the consumed gas). Most wallets set an automatic limit.
- Use Layer 2 networks. Arbitrum, Optimism, and Base process transactions for 1–10% of mainnet gas costs.