Calculate transaction costs based on gas limit and gas price.
Gas is the unit that measures the amount of computational effort required to execute operations on the Ethereum network. Every transaction and smart contract interaction consumes gas, and users must pay for this gas to incentivize miners (or validators) to process their transactions.
The gas limit is the maximum amount of gas you're willing to use for a transaction. Different operations require different amounts of gas:
If you set the gas limit too low, your transaction will fail but you'll still pay for the gas used. Setting it too high doesn't cost extra—you only pay for what's actually used.
The gas price is how much you're willing to pay per unit of gas, measured in Gwei (1 Gwei = 0.000000001 ETH). Higher gas prices incentivize validators to include your transaction sooner.
Gas prices fluctuate based on network demand. During periods of high activity (major NFT drops, market volatility), gas prices can spike to 500+ Gwei. During quiet periods, they might drop to 10-20 Gwei.
The total transaction fee is calculated as:
For example, a simple ETH transfer with 50 Gwei gas price:
In August 2021, Ethereum implemented EIP-1559, which changed how gas fees work. Instead of a single gas price, transactions now have:
The base fee is algorithmically determined by the network based on demand. It adjusts block by block to target 50% full blocks. The base fee is burned (removed from circulation), making ETH deflationary during high usage.
The priority fee (or tip) goes directly to validators as an incentive to include your transaction. You can set a higher tip for faster inclusion.
The max fee is the maximum you're willing to pay per gas. Your actual cost will be:
If Base Fee + Priority Fee is less than your Max Fee, you get a refund on the difference.
Gas prices vary throughout the day. Generally, gas is cheaper during:
Layer 2 networks like Arbitrum, Optimism, and Polygon process transactions off the main Ethereum chain, offering significantly lower fees (often $0.01-$0.50 vs $5-$50 on mainnet).
If you need to make multiple transfers or operations, consider batching them into a single transaction using smart contracts. This saves on the fixed costs of transaction execution.
Don't overpay by setting excessive gas limits. Use wallets that estimate gas accurately, or check recent transactions for similar operations on Etherscan.
Use gas trackers like:
| Operation | Typical Gas Limit | Cost at 50 Gwei |
|---|---|---|
| ETH Transfer | 21,000 | 0.00105 ETH |
| ERC-20 Transfer | 65,000 | 0.00325 ETH |
| ERC-20 Approval | 45,000 | 0.00225 ETH |
| Uniswap Swap | 150,000 | 0.0075 ETH |
| NFT Mint | 100,000 | 0.005 ETH |
| NFT Transfer | 85,000 | 0.00425 ETH |
If a transaction fails (due to insufficient gas, smart contract errors, or other issues), you still pay for the gas consumed up to the point of failure. This is because validators already performed computational work.
Common causes of failed transactions:
Ethereum's roadmap includes several upgrades to reduce gas fees:
Times are estimates and vary by network congestion