Ethereum basics
How to calculate an Ethereum gas fee
Read the gas used and the effective gas price on a receipt, then calculate the amount paid in ETH.
Two ETH transfers of the same value can cost different amounts to send. To explain the difference, look for two numbers on each transaction receipt. Gas used measures the work performed. The effective gas price tells you how much each unit of that work cost.
Work through a receipt
Suppose a simple transfer uses 21,000 gas at an effective price of 12 gwei per unit. Multiplying the two gives 252,000 gwei. One billion gwei equals one ETH, so the fee is 0.000252 ETH. If the transfer sent 0.05 ETH, the sender spent 0.050252 ETH in total.
Compare the estimate with the result
A wallet may show a gas limit and a maximum price before you sign. These put bounds on execution and price. When reconciling your balance afterward, use the gas actually consumed and the effective price on the receipt. A contract interaction can consume more gas than a simple transfer.
What if the transaction fails?
A transaction included in a block can fail during execution. Work already performed still consumes gas. When reviewing an unexpected charge, check the execution status alongside the fee and the amount transferred.
Further reading: Ethereum documentation on gas.