Gas is the unit that measures how much work a transaction asks the network to do, and a gas fee is that work multiplied by a price per unit. On Ethereum the work is computation, transaction data and changes to stored state, each with its own gas cost. A plain transfer of ETH uses 21,000 gas, while writing one new value to contract storage costs 22,100 gas on its own.

Key takeaways

  • Total fee = gas used x (base fee + priority fee). Gas used depends on what the transaction does; the price per unit depends on the market, which moves with demand for block space.
  • Every Ethereum transaction pays a flat 21,000 gas before any data or contract code is counted, plus a charge per byte of data it carries; deploying a contract adds 32,000 more.
  • Storage is the costly operation: setting a storage slot from zero to a non-zero value costs 20,000 gas, plus 2,100 if the slot is accessed for the first time in the transaction.
  • Gas that is allowed but not used is refunded. A contract that rejects a call returns the unused gas, but an out-of-gas failure consumes the whole limit.
  • The base fee portion is burned; only the priority fee (tip) goes to the validator.
  • These figures are protocol parameters. The next upgrade, Glamsterdam, is scheduled to reprice storage and other items, but as of 15 October 2026 it had no mainnet date.

Gas measures work, not money

A blockchain such as Ethereum asks thousands of computers to repeat the same calculations and keep the same data. Gas gives that shared effort a common unit, so a simple operation and a heavy one can be compared and priced. According to the Ethereum developer documentation, the fee is the units of gas used multiplied by the base fee plus the priority fee, and it is quoted in gwei, a unit equal to one billionth of an ETH (0.000000001 ETH).

Gas has three jobs. It pays for the resources a transaction consumes, it caps how much one transaction can take from a block, and it makes endless loops expensive enough to stop. Each EVM instruction (opcode) has a gas cost set by the protocol rules. Some costs are fixed; others, such as storage writes, depend on the data involved and on whether it was already touched in the transaction. Two identical transactions therefore use the same gas only when the state they act on is the same.

The price side is a separate matter. How the per-unit price moves with demand is a market question, and this article leaves it aside to focus on the quantity side: what the units are charged for.

What the 21,000 base cost covers

A plain ETH transfer between two ordinary accounts needs no contract code to run, yet it still costs 21,000 gas. The Ethereum documentation gives this as the gas limit for a standard transfer. The protocol's gas formula, as written in EIP-7623, starts every transaction at 21,000 before anything else is counted. A transaction that deploys a contract adds 32,000 plus a charge for the size of its initialization code.

On top of that flat amount come charges for data attached to the transaction (calldata). Under EIP-2028, each non-zero byte costs 16 gas, down from 68, and zero bytes cost 4. Contract creation and contract calls then add the cost of every opcode they execute.

The 2025 calldata floor

A later change, EIP-7623, sets a minimum price for data-heavy transactions. Data is counted in "tokens" (a zero byte is 1 token, a non-zero byte is 4), and the transaction must pay at least 21,000 + 10 x tokens. Transactions dominated by computation stay on the standard 4/16 pricing because the standard formula is the larger of the two. The upgrade that carried it, Pectra, activated on mainnet at timestamp 1746612311, which is 7 May 2025 (UTC).

Illustrative example: a transaction carrying 1,000 non-zero bytes and no execution has 4,000 tokens. At the standard 4 gas per token it would cost 21,000 + 16,000 = 37,000 gas. The floor of 21,000 + 10 x 4,000 = 61,000 gas applies instead, 24,000 gas more.

Why storage is the expensive part

Most opcodes work on temporary memory that disappears when the call ends. Storage is different: a value written to a contract's storage becomes part of the chain's state, which every full node must keep and look up later. The protocol prices that permanence accordingly.

The rules, as set out in EIP-2200 and EIP-2929 and summarized here, are:

  • New value (zero to non-zero): 20,000 gas.
  • Overwrite (non-zero to a different non-zero value): 2,900 gas.
  • First access to a slot in the transaction ("cold"): an extra 2,100 gas on top of the write cost.
  • Repeat access to the same slot ("warm"): a read costs 100 gas.

The cold surcharge exists because EIP-2929 found state-access opcodes historically underpriced: the first lookup of untouched state can force a node to read from disk. A first write to a fresh slot therefore costs 22,100 gas and a first overwrite costs 5,000 gas, each 2,100 more than the same write once the slot is warm (20,000 and 2,900).

Worked example: three transactions at one gas price

Assumption, not a market quote: a total price of 10 gwei per gas, chosen only to make the arithmetic readable. The two contract calls carry 36 bytes of calldata (a 4-byte function selector and one 32-byte value), all counted as non-zero at 16 gas each, which is 576 gas. Other opcodes in a real contract (function dispatch, checks, events) are ignored, so the contract figures are approximations: zero bytes in the data would lower the calldata line (a value of 1 has 31 zero bytes), while dispatch and checks add a few hundred gas or more. Under EIP-7623, the floor for this data is 21,000 + 10 x 144 = 22,440, below each total, so the standard formula applies.

Transaction Gas used Fee at 10 gwei Fee in ETH Multiple of a transfer
Plain ETH transfer 21,000 210,000 gwei 0.00021 1.00x
Contract call, overwrite one cold slot 26,576 265,760 gwei 0.00026576 1.27x
Contract call, write one new cold slot 43,676 436,760 gwei 0.00043676 2.08x
gas used = 21,000 + calldata gas + opcode gas
new slot  = 21,000 + 576 + (20,000 + 2,100) = 43,676
overwrite = 21,000 + 576 + (2,900 + 2,100)  = 26,576
fee (gwei) = gas used x 10      fee (ETH) = fee (gwei) / 1,000,000,000

The new slot alone costs 22,100 gas, which is 4.4 times the 5,000 for an overwrite and slightly more than the entire plain transfer. Creating new state, not moving value, is what makes a contract call expensive. A real application that writes several slots multiplies this figure; a token swap that updates balances in two or three places lands well above these figures.

Nothing here uses the amount sent. A transfer of 0.01 ETH and one of 1,000 ETH both use 21,000 gas.

Figures scheduled to change

The storage and data costs above are current on mainnet as of 15 October 2026. Fusaka, the upgrade after Pectra, activated on 3 December 2025 at 21:49:11 UTC (EIP-7607). It left them unchanged, but it raised the price of one built-in function, the ModExp precompile: under EIP-7883 its minimum cost went from 200 to 500 gas and its general cost tripled.

The next upgrade, Glamsterdam, went live on the Sepolia test network on 6 October 2026 and had no mainnet date as of 15 October 2026, according to EIP-7773. Its scheduled changes include new pricing for the intrinsic cost, calldata, access lists, state access and state creation. The state-creation proposal, EIP-8037, was in Last Call, the final review stage, with a deadline of 1 November 2026. It would charge 97,920 gas for the state created by a new storage slot instead of 20,000, with separate execution charges still being set on top. Under EIP-2780, a plain transfer to an existing account would stay at 21,000. Both proposals could change before activation.

Gas limit, gas used and refunds

Each transaction states a gas limit, the most gas the sender allows it to consume. Wallets usually fill this in with an estimate. Since Fusaka, EIP-7825 caps that limit at 16,777,216 gas (2 to the 24th power) for any single transaction, whatever the block gas limit; a transaction above it is invalid. The limit is not a charge. Per the EIP-1559 specification, the sender pays for gas actually used, and unused gas (limit minus used) is returned at the effective gas price.

Illustrative example: if the contract call that writes a new slot (43,676 gas used) were sent with a limit of 50,000, the 6,324 unused gas would be refunded. At the assumed 10 gwei, that is 63,240 gwei returned, 0.00006324 ETH. Before inclusion, the account must be able to cover the gas limit times the max fee per gas on top of any value sent. If the max fee is also 10 gwei, that is 50,000 x 10 gwei = 0.0005 ETH; a higher max fee raises the amount the balance must cover.

Refunds for freeing storage

A second, separate refund exists for clearing storage. EIP-3529 set it at 4,800 gas for resetting a slot to zero and capped total refunds at one fifth of the gas used (previously one half), and it removed the self-destruct refund. The reduced refunds make it harder to game gas pricing by storing and deleting data, and mean a transaction cannot be made almost free by clearing many slots: with 100,000 gas used, at most 20,000 gas can come back.

Who gets paid, and when gas is lost

Under EIP-1559 the fee splits in two. The base fee is burned, which the specification describes as being given to no one, and the priority fee on the gas used goes to the block producer. In the Ethereum documentation's example, a 21,000-gas transfer with a 10 gwei base fee and a 2 gwei tip costs 0.000252 ETH, of which 0.00021 ETH is burned and 0.000042 ETH reaches the validator. The base fee itself is set by the protocol per block from recent demand, which is the only market mechanic this article needs.

Failed transactions still pay

Two different things get called a "failed transaction", and they cost differently.

  • Included, then reverted. The EVM undoes the state changes, but the Ethereum documentation states the fee is paid regardless of success. What is charged depends on how execution stops. When a contract rejects the call with the REVERT instruction (a failed check, for example), the sender pays for the gas used up to that point and the rest is returned, per EIP-140. When execution runs out of gas or hits an invalid instruction, all the gas provided is consumed. A call that needs 43,676 gas but is sent with a 40,000 limit pays for 40,000 gas and achieves nothing. Resending it costs 43,676 more, 83,676 in total, almost twice the cost of setting the limit right.
  • Rejected before inclusion. A transaction must be valid to enter a block. The EIP-1559 specification requires the signer to afford value plus gas limit times max fee per gas, and it makes a block invalid if a transaction's max fee per gas is below the block's base fee. The Ethereum documentation adds that a gas limit too low to pass validation also leads to rejection with no gas consumed. A transaction that fails these checks is not executed and pays nothing. One whose max fee is merely below the current base fee may wait unconfirmed and still be included later if the base fee falls.

Frequently asked questions

Is the fee I see when sending the fee I pay?

Not necessarily. The wallet sets a maximum fee per gas, but under EIP-1559 the sender pays the effective gas price, which is the base fee plus a tip capped by that maximum. Any amount by which the maximum exceeds the effective price is never deducted. The final figure depends on the base fee of the block that includes the transaction.

Does sending a larger amount cost more gas?

On Ethereum, no: the value transferred is not an input to the gas formula, and a plain transfer is 21,000 gas whatever the amount. Bitcoin works on a different basis: the Bitcoin developer guide says fees are based on the total byte size of the signed transaction, a measure in which the amount sent plays no part. In both cases the fee tracks the resources used, not the money moved.

Can clearing storage make a transaction cheap?

Only partly. Resetting a slot to zero earns a 4,800 gas refund, but the total refund is capped at one fifth of the gas used under EIP-3529. The cap means the refund can reduce a bill by at most 20% of the gas used, not eliminate it.

Why did the price of data change?

EIP-2028 cut the cost of a non-zero calldata byte from 68 to 16 gas, which made it cheaper to send data to contracts. EIP-7623 later added a floor of 10 gas per token for transactions that are mostly data, so that very data-heavy transactions pay more than the 4/16 rates alone would charge.

Does a bigger gas limit make a transaction faster?

No. The limit caps the work the transaction may do, and it is not a bid for priority. The tip per gas is what the sender offers the validator, as the Ethereum documentation's fee formula shows. Setting the limit below what the transaction needs causes an out-of-gas failure and a charge for the gas consumed.

Reading a gas estimate

  1. Check what the transaction does. A plain transfer is 21,000 gas; any contract call is at least that and usually more.
  2. Compare the wallet's gas limit with the typical range for that action. A limit far below the estimate risks an out-of-gas failure; a larger one is refunded when unused, though it requires the balance to cover limit x max fee up front.
  3. Convert the fee to the native unit: gas x price in gwei, divided by 1,000,000,000 to get ETH. Convert to dollars only with a current, dated exchange rate.
  4. Treat the opcode costs above as protocol parameters that change through upgrades. This guide reflects mainnet as of 15 October 2026, before Glamsterdam. Once that upgrade has a mainnet date, check its final EIPs before relying on the storage, data or base-cost figures here.

Sources

Crypto

What to Understand Before Holding Any Crypto

Crypto has no FDIC or SIPC cover, and bitcoin's worst fall since 2016 was 84%: the facts to weigh first. The guide sets out what changes when the asset is crypto rather than a stock or a bank balance: holding a private key versus holding a claim on a platform, as the Celsius and FTX bankruptcy rulings showed; ten years of FRED price data on volatility and drawdowns; why the FBI's 2025 fraud figures matter when transfers are final; spreads, network fees and a worked break-even example; property tax treatment and the new Form 1099-DA; the SEC, CFTC and GENIUS Act picture as of October 2026; and what heirs would need to reach the coins.

Read the full guide 21 OCT 2026
Crypto

What an Exchange Does Behind the Scenes

Most crypto trades settle on an exchange's own books, not the blockchain, which changes who holds your coins. A centralized crypto exchange usually performs jobs that US stock markets split across separate registered firms: taking orders, matching them, keeping custody and recording the result. This guide follows an account from identity checks to a trade, its fees and a withdrawal, using a worked example with round numbers to show which balances change inside the platform and which change on the blockchain. It also explains what a proof-of-reserves report can and cannot show, what the Celsius bankruptcy ruling and New York's custody guidance say about customer assets, and which questions to ask before moving money onto any platform.

Read the full guide 21 AUG 2026
Crypto

Why Network Congestion Raises Fees

When blocks fill up, a 60% jump in demand can lift the fee needed to get into the next block twentyfold. Bitcoin and Ethereum both sell a fixed amount of block space every few seconds or minutes, and congestion turns that space into an auction. The guide shows how Bitcoin users bid in satoshis per virtual byte and fix stuck payments with RBF or CPFP, how Ethereum's base fee climbs 12.5% per full block and is burned, and how blob fees price rollup data. Worked examples cover a 140 vB payment at different fee rates, a 21,000-gas transfer and a base fee path across 20 full blocks, along with the fee spikes of May 2023 and the April 2024 halving block.

Read the full guide 02 OCT 2026

Educational content only. Nothing on this site is personal financial, investment, tax or legal advice.