How to use the Gas Fee Calculator
- Choose Legacy gas price or EIP-1559. Legacy needs one gas price in gwei; EIP-1559 needs a base fee and priority fee.
- Enter the gas used or the gas limit you want to model. The presets are typical starting points, but contract execution varies.
- Optionally enter an ETH/USD price. The page shows ETH and wei even when that field is blank, and it never invents a dollar price.
Gas, gwei, and the formula
Gas is the unit of computation an Ethereum or EVM transaction consumes. A simple ETH transfer often uses about 21,000 gas, while a token transfer or swap can use more. Gas used is the work actually consumed; a gas limit is the maximum work you permit. The estimate is fee in ETH = gas units × gas price in gwei ÷ 1,000,000,000. One gwei is one billionth of an ETH, so the divisor converts gwei into ETH. The page also reports wei, the smallest ETH unit, using integer arithmetic so large gas and gwei inputs do not lose precision through floating-point rounding.
Legacy versus EIP-1559
Legacy pricing has a single gas price. EIP-1559 separates the base fee from the priority fee, or tip: effective gas price = base fee + priority fee. A max fee is a ceiling per gas, not a promise that the whole cap will be spent. This calculator reports unused headroom as max fee minus effective price. If the cap is below base plus tip, it stops and shows an error because that transaction cannot be funded under the entered cap. Read Ethereum's gas documentation and EIP-1559 specification for protocol detail.
Worked example
For a 150,000-gas contract call at 20 gwei, the arithmetic is 150,000 × 20 ÷ 1,000,000,000 = 0.003 ETH. If you enter an ETH price of $3,200, the displayed multiplication is $9.60. In EIP-1559 mode, 21,000 gas at a 10-gwei base fee plus a 2-gwei tip uses 12 gwei: 21,000 × 12 ÷ 1,000,000,000 = 0.000252 ETH. These examples are deterministic calculations, not quotes about what the network currently charges.
Common mistakes
- Confusing gas limit with gas price: the limit is units, while gwei is the price per unit.
- Entering an ETH price as if it were gwei. The USD field is a separate optional multiplication.
- Assuming a swap always costs the preset amount. Contract paths, calldata, storage, and network conditions change usage.
- Treating a max-fee cap as the final paid fee. It is a ceiling; the effective fee depends on the transaction and block.
When this tool is the wrong one
Use a wallet's transaction preview or a contract-specific simulation when you are about to sign, when a transaction failed, or when the exact gas usage matters. This page cannot inspect calldata, estimate a contract execution path, know a chain's current base fee, or determine whether an address or contract is safe. It also cannot predict a future ETH price. It is useful for learning units, comparing scenarios, and checking arithmetic after you have a quote.
Good to know
Everything runs locally in your browser. No wallet, account, price feed, API, or transaction signer is present. The optional ETH price is your assumption and may become stale immediately. This calculator is educational arithmetic only and is not financial advice — arithmetic only.