Skip to content
All option guides
Ethereum gas fees10 min read

Ethereum Gas Fees Explained: Base Fee, Priority Fee, and Gas Limit

Learn what gas units, gas limits, base fees, priority fees, and maximum fees mean on Ethereum, then calculate the actual cost of a transaction.

In this guideGas measures computation, not the amount you send

Short summary

Ethereum gas fees are calculated by multiplying the gas a transaction actually uses by its effective gas price in the included block. The protocol sets and burns the base fee; a priority fee can go to the validator. A maximum fee is a cap, not necessarily the price you pay.

Gas measures computation, not the amount you send

On Ethereum, gas is the unit used to count the computation required to process a transaction in the EVM. A simple ETH transfer takes comparatively little work; moving a token or executing several smart-contract conditions can require more. Two transactions that send the same amount of ETH can therefore use different amounts of gas when they perform different work.

Gas units describe the amount of work. The gas price describes how much ETH you offer per unit. Multiplying the two gives a fee. A gas limit is the maximum number of units the transaction may consume, while maxFeePerGas is a cap on the price per unit. These fields are not interchangeable versions of one “maximum fee.”

This guide covers a standard EIP-1559 transaction on Ethereum mainnet. Other blockchains and layer 2 networks may use different fee structures, payment assets, and labels. Do not apply Ethereum's terms automatically to every network. Ethereum.org's gas guide and transaction guide define the fields.

Gas usage depends on the work a transaction performs

The EVM assigns gas costs to computation and state changes. A contract call can add function execution, storage reads or writes, and event records that a simple transfer does not need. More operations or a longer execution path may consume more gas. The gas used is not calculated by multiplying the amount of ETH sent or the market price of a token.

An ETH transfer, a token transfer, and a call to a dapp execute different operations. Contract calls can run additional functions and read or update storage, so they can use more gas than a simple transfer. For an included transaction, the receipt reports the amount of gas actually used.

Ethereum.org gives 21,000 gas as the example for a standard ETH transfer. That is a reference for a simple transfer, not a reusable gas limit for contract calls, whose work depends on the functions and storage access they execute.

Network gas is also different from a service's withdrawal fee. An exchange may add an operational charge or use its own fee schedule. On-chain gas pays for computation processed by the network. When a withdrawal screen shows a single amount, check whether it combines a platform fee with the network cost.

The gas limit and gas used are different numbers

The gas limit (gasLimit) is the maximum number of gas units the transaction is allowed to consume. Gas used (gasUsed) is the amount it actually consumes when execution finishes. Setting a higher limit does not automatically mean every unit in that limit is charged. For an included transaction, the fee uses the gas actually consumed and the effective gas price; unused limit units are not consumed.

If the transaction itself runs out of gas during execution, the full gas limit is consumed and the transaction fails. Its state changes are reverted, but the computation still costs a fee. A higher limit permits more work but also raises the maximum gas-cost exposure: gasLimit × maxFeePerGas. The actual charge still depends on gas used and the effective price.

The gas limit is a ceiling, not a prediction of actual usage. The limit is not the unit price, and increasing the price does not fix an insufficient number of gas units. If you do not understand what a call will execute, review the wallet or app's official guidance instead of changing the limit arbitrarily.

The base fee moves with demand for block space

For an EIP-1559 transaction, the base fee is the protocol-set price per gas for a block. The transaction's maximum fee must be high enough to cover the base fee of the block that includes it. The protocol adjusts the base fee from block to block based on how much gas the previous block used relative to its target. It can rise or fall; it is not a permanent fixed rate.

The base-fee portion for the gas actually used is burned. Validators do not receive that portion as a tip. Because the base fee changes from block to block, a pending transaction may face a different base fee when it is included than it did when it was submitted.

Gwei is a small denomination of ETH: 1 gwei equals 0.000000001 ETH. A higher gas price increases the ETH cost even if the gas used stays the same. More gas used increases the cost even if the per-unit price is unchanged. Both can change the ETH-denominated fee, independently of ETH's dollar price.

The priority fee is a tip that can encourage inclusion

The priority fee is a per-gas tip offered to the validator that includes a transaction. Users compete for limited block space, so a larger tip can make a transaction more attractive when other conditions are similar. It signals urgency, but does not guarantee inclusion in a particular block or by a particular time.

A priority fee shown as a high number is separate from the amount of gas units the transaction needs. The priority fee changes the price per unit; the gas limit caps the permitted work. A complicated contract call can still fail if it has too little gas, even with a high tip. Conversely, enough gas units do not help if the price cap cannot cover the block's base fee.

Validators consider block space and other transaction conditions when selecting transactions. The base fee and available block space change over time, and a larger tip does not guarantee inclusion at a particular time. The EIP-1559 specification gives the base fee and priority fee separate roles and caps their combined effective price.

The maximum fee is a price cap, not the actual price

maxFeePerGas is the highest price per unit you are willing to cover. maxPriorityFeePerGas is the highest per-unit tip you offer. When the transaction is included, its effective price is the base fee plus the tip that fits under both caps. The applied tip is limited to the smaller of maxPriorityFeePerGas and maxFeePerGas - baseFee, so the effective price cannot exceed the maximum fee.

For example, suppose the maximum fee is 30 gwei, the maximum tip is 2 gwei, and the block's base fee is 18 gwei. The tip can be 2 gwei, making the effective price 20 gwei. The transaction does not automatically pay 30 gwei just because that is the maximum. If the base fee rises to 31 gwei, a 30-gwei cap cannot cover that block, so the transaction cannot be included there.

As the base fee approaches the maximum fee, less room remains for a tip. Even with a 5-gwei tip cap, if maxFeePerGas - baseFee is only 1 gwei, the applied tip can be at most 1 gwei. Read the two caps together with the current base fee.

A text-free diagram shows a gas limit as a path: used units flow through while unused capacity returns.
The fee uses gas actually consumed; unused gas-limit capacity is not charged.

Work through an illustrative fee calculation

The following figures are hypothetical and only demonstrate the arithmetic. Suppose a transaction has a gas limit of 30,000 units, uses 24,000 units, and is included in a block with an 18-gwei base fee. Set the maximum tip to 2 gwei and the maximum fee to 30 gwei. The applied tip is min(2, 30 - 18) = 2 gwei, so the effective price is 18 + 2 = 20 gwei.

The actual gas fee is 24,000 × 20 = 480,000 gwei. Since 1 ETH equals 1,000,000,000 gwei, that is 0.00048 ETH. The base-fee portion is 24,000 × 18 = 432,000 gwei, or 0.000432 ETH. The tip is 24,000 × 2 = 48,000 gwei, or 0.000048 ETH. Together they equal the 0.00048 ETH actual fee.

Multiplying the full gas limit by both caps gives 30,000 × 30 = 900,000 gwei, or 0.0009 ETH, as the gas-cost ceiling under those settings if the limit and maximum unit price were both fully used. That is not the actual fee in this example. The ETH amount sent to a recipient is separate from the gas fee. Do not treat the cap as a fixed charge or the fee as a percentage of the transfer. These figures are illustrative, not a live quote.

A failed transaction can still consume gas

Do not assume that a wallet's “failed” message means the gas fee is refunded. If a transaction is included in a block and EVM execution starts before reverting, the state change can be undone while the gas used for the computation still costs a fee. If the transaction itself runs out of gas, the full gas limit is consumed. The computation took place even though the intended result did not.

A transaction that fails validation before it is included is different. For example, an ETH transfer submitted with less gas than the required amount can be rejected before it enters a block; in that case, no execution gas is consumed. “Rejected before inclusion” and “included, then reverted during execution” are not the same state.

Check the transaction hash for its status, gas used, effective gas price, and execution result. A wallet's short error message may not identify the cause. Ethereum.org distinguishes a pre-inclusion validation rejection from a transaction that runs out of gas during execution.

Read the limit, price, and transfer amount separately

Before signing, confirm which network you are using and whether the transaction is a simple transfer or a contract call. The wallet may show an estimated fee, gas limit, estimated base fee, priority-fee cap, maximum-fee cap, and the ETH or token amount being sent. Those values answer different questions. If the screen shows only a maximum gas cost, open the details to learn which cap it represents instead of treating it as a certain debit.

If your wallet fills in fee values automatically, treat them as estimates based on network conditions at that moment; they do not guarantee when a transaction will be included or what it will ultimately cost. A low price cap can leave it waiting. Increasing the limit or tip without understanding the call can raise the possible cost without fixing the underlying issue. Review the current values and sign only if the transaction makes sense to you.

This explanation covers the standard Ethereum mainnet transaction path. A layer 2 or another chain may show additional data fees, use a different fee asset, or calculate fees differently. Do not copy the Ethereum formula to another network without checking its documentation. For the destination network and address, see the crypto transfer checklist; for the separate permission a contract may have to use tokens, see the token approval guide.

Common questions

Q1Why can a failed transaction still cost ETH?

If the transaction was included and execution began, the computation may consume gas even when the state change is reverted. Check the transaction hash to distinguish an execution failure from rejection before inclusion.

Q2Is `maxFeePerGas` the actual gas price shown by my wallet?

No. It is a per-unit price cap. The effective price combines the included block’s base fee with the tip that fits within the caps, so the transaction may pay less than the maximum.

Q3Do Ethereum mainnet transactions pay gas in ETH?

Standard Ethereum mainnet transactions pay gas in ether, the network’s native asset. If a wallet shows another token or a third-party sponsor, check whether a separate fee-payment mechanism is involved. Other chains may work differently.

Sources and further reading

Report an issue

We’ll prepare an email with this article link. Mark receives the report only after you send it

Quick check

Read the guide? Check yourself with 3 questions

Question 1 / 3

Question 01

What does `gasLimit` represent?

Choose an answer to see the explanation

Options glossary