Skip to content
Finance Lessons

Ethereum

Gas and Fees: Paying the World Computer

How Ethereum fees work: gas as a unit of computational work, the gas limit, and EIP-1559's base fee (burned) plus priority tip (to the validator). Why fees spike when the network is busy, and how to read a fee in gwei.

9 min Updated Jun 3, 2026

You already know Ethereum is a world computer — a single shared machine, the EVM, that runs everybody’s programs and remembers the result forever. Lovely. But here’s the awkward part nobody puts on the brochure: that computer is run by thousands of strangers’ machines, and none of them work for free. Every single step of computation — every addition, every storage write, every “if” — costs real electricity and real time on real hardware.

So Ethereum needs two things at once. First, a way to charge you for exactly how much work your transaction makes the network do. Second, a way to stop a program from running forever — because on a shared computer, one infinite loop with no off-switch would freeze the machine for the entire planet. The mechanism that solves both at once is called gas.

Gas: Metering Computational Work

Before you read — take a guess

Guess before reading: on Ethereum, what does ‘gas' actually measure?

Gas is a unit that measures how much computational work an operation costs. Every instruction the EVM can run has a fixed gas price-tag attached: cheap arithmetic costs a few units, while writing a new value into the chain’s permanent storage costs thousands. Add up the cost of every step your transaction performs, and you get the gas it uses.

The numbers everyone memorizes: a plain ETH transfer always costs exactly 21,000 gas. That’s the floor — the fixed cost of any transaction just for existing and being processed. Anything more complicated (calling a smart contract, swapping tokens, minting an NFT) does extra work on top, so it burns more gas.

The cleanest way to think about it: gas is like the litres of fuel a trip burns. A quick trip to the corner shop burns a little; a cross-country haul burns a lot. Crucially, how much fuel a trip needs is separate from what fuel costs today — and the same split shows up in Ethereum. Gas measures the work; a separate gas price says how much you’ll pay per unit. We’ll get to price in a second.

The gas limit: your circuit breaker

When you send a transaction you also set a gas limit — the maximum amount of gas you allow it to consume. This is your safety valve. Remember the infinite-loop problem? The gas limit is the off-switch: the EVM counts down your gas as it works, and the instant the limit is hit, execution halts. A buggy or malicious contract literally cannot run away with your wallet, because it runs out of gas first.

Here’s the sting, though. If a transaction runs out of gas partway through, it reverts — all its state changes are undone, as if it never happened — but you still pay for the work already done. The network spent real resources computing up to the failure point, so it keeps the fee for that work even though you got nothing. (For a simple transfer this never happens: 21,000 gas is exactly what it needs, so wallets set the limit to 21,000 and you’re fine.)

Pick the right word for each blank.

Pick the right option for each blank, then check.

Gas measures the computational a transaction does, and a plain ETH transfer always costs gas. The gas is the maximum you allow a transaction to consume, which protects you from a buggy contract. If a transaction runs out of gas it , and you still for the work already done.

The Fee Formula

Knowing the work isn’t enough; you need the price. The core formula is wonderfully simple:

fee = gas used × gas price

Or, if you like it tidy in math: fee=gas used×gas price\text{fee} = \text{gas used} \times \text{gas price}.

Gas prices are quoted in gwei (pronounced “gway”), a tiny denomination of ETH that keeps the numbers human-sized. The conversions you need:

  • 1 gwei = 0.000000001 ETH (that’s 1 billionth, or 10⁻⁹ ETH)
  • 1 gwei = 1,000,000,000 wei (10⁹ wei — wei is the smallest indivisible unit of ETH)

Why bother? Because raw ETH amounts for a fee would be absurd strings of zeros. Gwei is the sane middle unit — like quoting petrol in cents per litre instead of fractions of a dollar.

A fully worked example

Let’s price a simple transfer when the gas price is 30 gwei.

  1. Gas used: a transfer is fixed at 21,000 gas.
  2. Multiply by price: 21,000 × 30 = 630,000 gwei.
  3. Convert to ETH: 630,000 gwei × 0.000000001 ETH/gwei = 0.00063 ETH.
  4. Convert to dollars (say ETH = $3,000): 0.00063 × 3,000 = $1.89.

So that transfer costs 0.00063 ETH ≈ $1.89. Change any one input and the fee moves proportionally: double the gas price to 60 gwei and the fee doubles to ~$3.78; do a heavier operation that uses more gas and it climbs from there.

Here’s roughly what common operations cost, in gas:

OperationRough gas costWhy
Plain ETH transfer21,000The fixed floor — no contract code runs
ERC-20 token transfer~50,000Updates a contract’s balance bookkeeping
Uniswap token swap~120,000–150,000Routes through contract logic and price math
NFT mint~80,000Writes new ownership data into storage

Notice the pattern: more work touching more storage → more gas → bigger fee at the same gwei price. The price is the same for everyone in a block; the work is what differs.

An NFT mint uses 80,000 gas and the gas price is 25 gwei. What's the fee in ETH?

EIP-1559: Base Fee + Tip

For Ethereum’s first six years, the gas price was a pure blind auction — you guessed a number, and if you guessed too low your transaction sat there. In August 2021, an upgrade called EIP-1559 (“Ethereum Improvement Proposal 1559”) replaced that mess with a smarter, mostly-automatic fee market. It’s how things work today, and it splits the price per gas into two parts:

  • Base fee — a price per gas that the protocol itself sets for each block, based on how full recent blocks have been. You don’t bid it; the network calculates it. And here’s the twist that makes Ethereum unusual: the base fee is burned — destroyed, removed from the ETH supply forever. Nobody pockets it.
  • Priority fee (also called the tip) — an optional extra per gas that goes to the validator who includes your transaction. It’s a bribe-with-a-nicer-name: tip more, and a validator has more reason to pick you first when blocks are crowded.

So the price you actually pay per unit of gas is:

price per gas = base fee + priority fee (tip)

And the total fee is that, times the gas used. Drag the demand slider below all the way up, pick a transaction type, and watch the base fee climb while you choose how big a tip to add — then see your total fee split into the part that gets burned versus the part that goes to the validator.

Where your gas fee goes (EIP-1559)Total fee: 0.00612 ETH
calmbusy
Transaction type (gas used)
Burned (base fee)To validator (tip)
Burned (base fee)
0.00588 ETH
49 gwei × 120,000 gas
To validator (tip)
0.00024 ETH
2 gwei × 120,000 gas
Total fee
0.00612 ETH
51 gwei × 120,000 gas

Drag network demand higher and watch the base fee rise. Pick a transaction type and a tip, then see your total fee split into the burned base fee and the validator's tip. The base fee is set by the protocol; only the tip is yours to choose.

Max fee vs. max priority fee

Your wallet hides all this behind two settings, and now you can read them:

  • Max priority fee — the most you’re willing to tip the validator, per gas.
  • Max fee — the absolute ceiling you’ll pay per gas, including the base fee. It’s a safety cap so a sudden base-fee spike can’t drain your wallet beyond what you agreed to.

The clever bit: you’re refunded the difference. You only actually pay base fee + tip, even if your max fee was set higher. Say the base fee turns out to be 20 gwei, your tip is 2 gwei, but your max fee was 50 gwei — you pay 22 gwei per gas and the other 28 gwei is never charged. The max fee is a guardrail, not the price.

Connect every term on the left to its correct meaning.

Pick a term, then click its definition.

Why Fees Spike

Block space is scarce — each block can only hold so much gas. EIP-1559 turns the base fee into a thermostat for that scarcity. The rule: each block targets being half full. When the previous block ran fuller than the target (demand > supply), the protocol nudges the base fee up for the next block; when blocks come in below target, it nudges the base fee down. The maximum swing is about 12.5% per block in either direction.

So during a frenzy — a hot NFT drop, a market crash, everyone piling in at once — blocks fill past target again and again, and the base fee ratchets up 12.5%… 12.5%… 12.5%, block after twelve-second block. Compound that a few dozen times and a fee that was a couple of dollars becomes a couple of hundred. When the rush passes and blocks empty out, the same mechanism walks the base fee back down.

It’s textbook surge pricing. Quiet Tuesday at 3am, the ride is cheap; New Year’s Eve at midnight, it costs a fortune — same trip, different demand. Nothing about your transaction changed; the competition did.

It feels wasteful, but the burn does two real jobs. First, deflationary pressure: burning ETH permanently shrinks the supply, so when network usage is high, more ETH leaves circulation than gets created — making each remaining ETH a slightly larger slice of a smaller pie. Heavy usage literally makes ETH scarcer.

Second — and this is the subtle one — it removes a perverse incentive. If validators received the base fee instead of it being burned, they’d be tempted to game the fee market: secretly pad blocks, collude, or manipulate congestion to pump up the fee they collect. Burning the base fee means validators gain nothing from a high base fee — they only earn the tip. That cleanly separates “the protocol’s congestion price” (burned, un-gameable) from “the validator’s reward” (the tip, which they legitimately compete for). Destroying the money is exactly what keeps the fee market honest.

Reading and Lowering a Fee

Now you can actually read a wallet screen. A line that says “30 gwei” is the price per gas; multiply by your transaction’s gas (21,000 for a transfer, more for contracts) and convert to get the ETH cost. A wallet showing a high gwei estimate isn’t broken — it’s just telling you the base fee is currently high because the network is busy.

How to pay less, in order of impact:

  • Time it. Base fee tracks demand, so transacting during quiet hours (weekend nights, off-peak) can cost a fraction of peak. There’s no premium for patience.
  • Tip less when you’re not in a hurry. If you don’t need next-block inclusion, a small tip is fine — you’ll just wait a block or two longer.
  • Use a Layer 2. This is the real fix, and we’ll meet it soon: L2s are separate, cheaper chains that bundle thousands of transactions and post a compressed summary back to Ethereum, slashing the per-transaction fee. When mainnet gas is brutal, L2s are where the activity actually goes.

And the rule that bites beginners: a failed transaction still costs gas. If your transaction reverts — slippage too tight, ran out of gas, a contract rejected it — you paid for the work the network did before it failed. “It didn’t go through” does not mean “it was free.”

Sort each statement into whether it's actually true about gas and fees, or a myth.

Place each item in the right group.

  • The base fee is burned, not paid to the validator
  • Higher network demand pushes the base fee up
  • The tip (priority fee) goes to the validator who includes you
  • A transaction that fails costs you nothing
  • Gas measures the dollar price of ETH at that moment
  • You always pay your full max fee, even if the base fee is low
  • A plain ETH transfer always uses 21,000 gas

The Big Picture

One picture, four ideas: gas is work, the fee formula prices it, EIP-1559 splits the price into a burned base fee plus a validator tip, and demand makes that base fee swing.

Big picture

Gas & fees

  • Gas & fees
    • Gas = work
      • Unit of computational work
      • Transfer = 21,000 gas
      • Gas limit caps runaway contracts
    • Fee formula
      • fee = gas used × gas price
      • Price quoted in gwei (10⁻⁹ ETH)
      • Failed tx still costs gas
    • EIP-1559 base + tip
      • Base fee set by protocol, burned
      • Priority fee (tip) to the validator
      • Max fee = ceiling, refund the rest
    • Why fees spike
      • Block space is scarce
      • Base fee adjusts ~12.5% / block
      • Surge pricing with demand
Gas meters computational work; the fee is gas used times the per-gas price; EIP-1559 splits that price into a burned base fee plus a validator tip; and the base fee rises and falls with network demand.

A mixed recap — it pulls from everything above:

Question 1 of 60 correct

What does gas measure on Ethereum?

Check your answer to continue.

Key Takeaways

Success:

What to remember

  • Gas measures computational work, not money or time. A plain ETH transfer is fixed at 21,000 gas; heavier contract calls (swaps, mints) burn more.
  • The gas limit is your circuit breaker — the max work you allow. It stops runaway contracts, but if a transaction runs out of gas it reverts and you still pay for the work done.
  • fee = gas used × gas price, with prices quoted in gwei (1 gwei = 10⁻⁹ ETH). Worked floor: 21,000 × 30 gwei = 0.00063 ETH ≈ \$1.89 at ETH = $3,000.
  • EIP-1559 splits the price into base fee + tip. The base fee is protocol-set and burned; the priority fee (tip) goes to the validator. Your max fee is just a ceiling — you’re refunded the difference.
  • Fees spike with demand: the base fee adjusts ~12.5% per block toward a half-full target, so congestion compounds into surge pricing. Transact in quiet hours, or use a Layer 2 to pay far less.

Next up: we go from paying the world computer to programming it — smart contracts and tokens, the actual code and assets that all this gas is buying you.

Mark lesson as complete