Gas limit is the maximum amount of computation you're willing to pay for. Gas price is the rate you pay per unit of that computation. One caps the work; the other sets the rate. Confuse them and you'll either overpay or watch a transaction fail after spending real money on it.
That distinction sounds academic until it costs you. Here's how each one behaves, where people get it wrong, and how to set both without guessing.
What gas limit actually caps
Every operation on Ethereum has a fixed gas cost. A plain ETH transfer costs 21,000 gas. Swapping tokens on a decentralized exchange might need anywhere from roughly 100,000 to several hundred thousand, depending on the route and how many pools it touches. The gas limit is your declaration of the ceiling: do not spend more than this much computation on my transaction.
If the transaction runs out of gas before it finishes, it reverts. The work still happened, so the fee is still charged. You get nothing back except a failed status.
Why the limit isn't a target
You're not charged the limit. You're charged for gas actually used, up to that limit. Set a limit of 200,000 on a transfer that only needs 21,000 and you'll pay for 21,000. No penalty. That's why wallets often pad the limit generously.
Where people get burned
The danger runs the other way. Set the limit too low on a complex contract interaction and the transaction dies mid-execution. Consider a common pattern: someone sets a 50,000 gas limit on a token swap because that's what a transfer cost last week. The swap needs more. It reverts, and they lose the fee on a transaction that accomplished nothing. Repeat that a few times at a busy moment and you've burned real money on zero results.
What gas price actually sets
Gas price is the rate per unit of gas, historically denominated in gwei (one billionth of an ETH). Multiply gas used by gas price and you get your fee. A 21,000-gas transfer at 20 gwei costs 420,000 gwei, or 0.00042 ETH.
Since EIP-1559, Ethereum splits this into a base fee that the protocol sets and burns, plus a priority fee (tip) you choose to incentivize validators. Most wallets show you a single max fee figure that bundles both.
The tradeoff you're actually making
A low gas price means cheap but slow. Your transaction sits in the mempool until conditions change or you replace it. A high gas price means fast and expensive. There's no free lunch, and setting a price far above the going rate doesn't buy you proportionally faster inclusion — it just donates money to the validator.
A quick comparison
| Gas limit | Gas price | |
|---|---|---|
| What it controls | Maximum computation | Rate per gas unit |
| Units | Gas | Gwei |
| Set too low | Transaction reverts, fee lost | Transaction stalls in mempool |
| Set too high | Usually harmless (you pay for actual use) | You overpay for the same speed |
A worked example: two variables, two failure modes
Say ETH is around $3,000 and the network is moderately busy. You're swapping tokens and your wallet suggests a gas limit of 180,000 and a max fee of 30 gwei.
- If the swap uses 150,000 gas, you pay 150,000 × 30 gwei = 4,500,000 gwei ≈ 0.0045 ETH ≈ $13.50.
- If you'd manually dropped the limit to 120,000 to save money, the swap would revert at the 120,000 mark and you'd still pay for that gas — roughly $10.80 for a failed transaction.
- If you'd doubled the gas price to 60 gwei out of impatience, you'd pay about $27 for the same inclusion speed.
The limit protects you from runaway computation; the price determines how fast you get in. Adjusting the wrong one is where the money leaks.
How to set both without guessing
Most modern wallets handle this well if you let them. Coinbase Wallet, like most reputable wallets, estimates the gas limit from simulation and suggests a fee tier based on current network conditions. You can usually pick slow, normal, or fast, or open advanced settings to enter values manually.
The practical rule: leave the gas limit at the wallet's estimate or slightly above it, and only touch the gas price if you have a reason — a time-sensitive transaction, or a quiet network where you can afford to wait. Never lower the limit to save money. That's not how the fee works.
When manual control pays off
During calm periods, dropping to a lower fee tier and waiting can save a meaningful fraction of the fee. During congestion, the opposite. Check a gas tracker before you commit if the amount matters to you. For small transactions, the savings from optimizing aren't worth the time — a few cents either way.
Frequently asked questions
Does a higher gas limit cost me more?
Not directly. You're billed for gas actually consumed, not the limit you set. A generous limit only matters if the transaction genuinely uses that much computation. Setting it unnecessarily high is usually harmless, though some wallets warn you because it signals you may not know what the transaction does.
Why did my transaction fail even though I paid a fee?
Almost always because the gas limit was too low for the work required. The network executed as much as it could within your limit, hit the ceiling, and reverted. Validators still did the work, so the fee stands. Raise the limit and try again.
Can I change the gas price after sending?
Yes, in most wallets, through a replace-by-fee or speed up function. You submit the same transaction with a higher fee, and the network typically picks up the replacement. The original fee isn't refunded separately — the replacement supersedes it.
Is gas price the same as the base fee?
No. The base fee is set by the protocol and burned. The priority fee is the tip you add to get included faster. What your wallet shows as the max fee combines both, which is why the number you see is higher than the base fee alone.
Next time you're about to confirm a transaction, look at the two numbers separately: is the limit enough for the work, and is the price right for how fast you need it? Get those two questions right and gas stops being a mystery line item.