EIP-1559 changed how Ethereum prices transactions: instead of a single gas price, you specify a max fee and a max priority fee, and the protocol works out what you actually pay. This calculator implements that logic exactly — computing the effective gas price, the burned base fee, the validator tip, the total cost, and any unspent refund — and warns you if your max fee is set too low.
How it works
The protocol caps your effective gas price and splits it into a burned and a tipped portion:
effective gas price = min(maxFeePerGas, baseFee + maxPriorityFeePerGas)
effective tip = effective gas price − baseFee (≥ 0)
burned per gas = baseFee
total fee (ETH) = effective gas price × gasLimit / 1e9
burned (ETH) = baseFee × gasLimit / 1e9
tip to validator = effective tip × gasLimit / 1e9
refund (ETH) = (maxFeePerGas − effective price) × gasLimit / 1e9
All gas-price values are in gwei, so dividing the gas-times-price product by 10
to the power of 9 converts to ETH. The min() is the heart of EIP-1559: you can
set a generous max fee for safety without overpaying when the network is calm.
Example and tips
With a base fee of 25 gwei, a max priority fee of 2 gwei, a max fee of 40 gwei, and a 21,000 gas transfer, the effective price is 27 gwei (25 + 2, which is below the 40 cap). Of that, 25 gwei per gas is burned and 2 gwei per gas tips the validator, for a total of 0.000567 ETH; the headroom up to 40 gwei is simply not spent. Set your max fee a few multiples above the current base fee so a sudden fee spike does not strand your transaction, but keep your priority fee modest — one or two gwei is usually enough outside congestion.