What Is a Gas Fee? Why It Changes, Why Failed Transactions Still Cost You, and How to Pay Less
Gas is not a service charge added by your wallet — it measures the computational work a blockchain performs. This guide breaks the fee into base fee, priority fee, max fee and gas limit, and explains why a failed transaction can still be charged.
Published Revised 7 min read
Rates and amounts in this article are from when it was published and may have changed since. Current figures: Fees by network (updated daily)
Last checked: August 21, 2026. This guide uses Ethereum mainnet's EIP-1559 fee mechanism as its worked example, to help first-time onchain users read a wallet confirmation screen. Other networks price transactions differently. Always defer to the official documentation for the network you are using and to the live figures on your wallet's confirmation screen. Educational content only, not investment advice.
If you are making your first onchain transfer, swapping a token, or connecting to a dapp, the confusing part is usually not the buttons — it is the network fee on the confirmation screen that keeps changing while you look at it. Gas is not a service charge added by the wallet or an exchange. It is the unit that measures the computational work a blockchain performs to execute your transaction and write the result to state.
This guide breaks the fee into its parts, explains why a failed transaction can still cost you, and gives you a checklist to run before you sign.

Screenshot: the official Ethereum gas documentation on ethereum.org, captured August 4, 2026, used to verify the definition of gas and the fee sections.
Start with one formula
On Ethereum mainnet, the network fee simplifies to:
Actual gas fee = gas units actually consumed × actual price per unit
Gas units reflect how much computational work an operation requires. The price per unit is normally expressed in Gwei, where 1 Gwei is one-billionth of an ETH. Per Ethereum's official documentation, under the EIP-1559 fee mechanism the unit price is composed mainly of a base fee and a priority fee (often called a tip):
- The base fee is set by the protocol according to how full recent blocks were. It is not something your wallet chooses.
- The priority fee is an incentive paid to validators. The more urgent your transaction, the higher your wallet may suggest setting it.
- The max fee is the ceiling you authorise for the unit price. It is not what you will necessarily be charged.
- The gas limit is the maximum number of gas units the transaction may consume. It is not the amount it will actually consume.
For example, a plain ETH transfer consumes 21,000 gas. If the base fee were 15 Gwei and the priority fee 2 Gwei at that moment, the illustrative cost would be:
21,000 × (15 + 2) Gwei = 357,000 Gwei = 0.000357 ETH
That is an example to make the formula concrete, not a live rate. When sending, rely on your wallet's confirmation screen and a block explorer.
Why the same action costs different amounts
1. Network demand changes
When more people compete to get transactions into blocks, the base fee can rise, and users may also raise their priority fee to be included sooner. When the network is quiet, both are typically lower. The same transfer can therefore show different estimates at different times of day.
2. Operations differ in complexity
Sending ETH from one address to another is not the same amount of work as swapping tokens in a smart contract, adding liquidity, or completing a multi-step approval. More computation means more gas units, independent of the unit price. This is why comparing a swap's fee against a simple transfer's fee tells you nothing useful.
3. The gas limit is a ceiling, not a charge
Setting a high gas limit does not by itself cost more. Unused gas is not consumed. But setting the limit too low carries real risk: if the transaction runs out of gas mid-execution, the state change is reverted while the gas already consumed is still paid. Unless you understand the contract's behaviour, use a reputable wallet's automatic estimate rather than lowering the limit to "save money." What determines your cost is actual consumption and actual unit price, not the ceiling number.
Why a failed transaction can still charge you
This is the part that feels unfair and is worth understanding precisely. There are two different situations:
- The transaction never made it onchain. If it was rejected before broadcast, or never included in a block, no onchain gas was consumed for it.
- The transaction was included in a block and then failed during execution. The network still performed the computation up to the point of failure. That work is paid for, even though your intended outcome — the swap, the transfer, the approval — did not happen.
Common causes of the second case: insufficient token allowance, a slippage setting the trade could not satisfy, a contract condition that was not met, or the gas limit running out mid-execution. In each case the validator did real work, so the gas is charged.
Which asset do you need for gas
On Ethereum mainnet, gas is paid in ETH. Token balances cannot substitute for it. You can hold USDT and still be unable to move it if you do not have enough ETH to cover gas. Other networks generally use their own native asset for network fees; confirm against that network's documentation and your wallet's confirmation screen.
If the relationship between assets, networks, and wallets is still unclear, start with the difference between exchange accounts and onchain wallets. When USDT is involved, also read why USDT transfer fees differ across networks — and never pick a chain purely because it is cheap without confirming the receiving side supports the same network.
Note that gas is a different mechanism from an exchange's withdrawal fee. A withdrawal from an exchange is priced by that platform; see how OKX withdrawal fees work for that side of the comparison.
A seven-point checklist before you send
- Verify the network. Your wallet's current network, the network the receiving address supports, and the network the asset lives on must all match.
- Keep a native-asset balance. Do not drain ETH or the equivalent to zero; leave headroom for this transaction and the next.
- Read the fee breakdown. Distinguish the estimate, the max fee, the gas limit, and the actual unit price.
- Account for complexity. A plain transfer and a contract swap cannot be judged against the same fee expectation.
- Do not blindly lower the gas limit. Too low a ceiling can exhaust gas mid-execution, costing you a failed attempt instead of a saving.
- For non-urgent transactions, wait for a quieter period. Watch the wallet's suggested fee rather than raising the priority fee to save a few minutes.
- Test with a small amount first. For a new address, a new network, or a large transfer, verify the route with an acceptable small amount — remembering the test itself incurs a network fee.
Before signing, confirm you understand what the transaction does. A normal-looking fee estimate says nothing about whether a contract is safe or a counterparty is trustworthy. Seed phrases, private keys, and verification codes are never required to "top up gas" or "unfreeze an account" — if you are asked for them, stop, read the safety boundary for seed phrases and private keys, and verify through official channels.
How to investigate a failed transaction
- Copy the transaction hash and look it up on that network's block explorer.
- Confirm whether the transaction actually entered a block, rather than still sitting locally in your wallet or in the pending pool.
- Check the status, any failure message, the gas used, and the effective gas price.
- Verify your native-asset balance, the network, token allowance, slippage setting, and the contract's current state.
- Only retry once you have found the cause — do not simply resend an identical transaction.
- If you cannot determine the cause, give only the public transaction hash to the official support channel of your wallet or dapp. Never provide seed phrases, private keys, cookies, or verification codes.
FAQ
Does the wallet collect the gas fee? Usually not. The wallet constructs, signs, and broadcasts the transaction and displays a fee estimate; the onchain gas is paid according to network rules. Third-party purchase, bridging, or aggregator services may add their own service fee, which should be shown separately on the confirmation screen.
If I set a high max fee, will all of it be charged? No. A high ceiling alone does not cause a high charge. The actual cost depends on actual gas used and the actual unit price; the unused difference is not consumed as gas.
Can I get gas refunded after a failure? If the transaction entered a block and executed, the network has already spent the computational resources, so gas is generally not refunded because the business outcome failed. If it was rejected before going onchain and no onchain execution occurred, no corresponding gas is consumed.
Does a higher fee guarantee success? No. A higher priority fee may get your transaction included sooner, but incorrect contract conditions, insufficient balance, insufficient allowance, or an unrealistic slippage setting can still cause execution to fail.
Sources
Educational content explaining public onchain fee mechanics, not investment advice. Interfaces, fee models, and supported features differ between networks and wallets; before acting, defer to the official documentation for your network and to your wallet's confirmation screen.
Want your own numbers? Fee calculator · Withdrawal fees