How do you calculate an Ethereum transaction fee?

Ethereum transaction cost depends on gas used and effective gas price. Under EIP-1559, effective gas price combines the base fee burned by the protocol and a priority fee paid to the validator, subject to the user’s maximum fee settings.

Transparent formula

Fee in ETH = gas used × effective gas price in gwei ÷ 1,000,000,000

Worked example

A basic transfer using 21,000 gas at 20 gwei costs 0.00042 ETH. At an ETH price of $3,000, that is about

.26. A swap may use far more gas, so its dollar cost can be much higher at the same gas price.

Use this sequence

  1. Estimate gas units for the action.
  2. Read current base and priority fee.
  3. Convert gwei to ETH.
  4. Convert ETH to fiat if needed.

Common mistakes

  • Using 21,000 gas for every transaction.
  • Confusing gas limit with gas actually used.
  • Ignoring failed transaction cost.

Verify next

Frequently asked questions

What is gwei?

One gwei is one billionth of an ETH and is the common unit for gas price.

Why does a swap cost more than a transfer?

Smart-contract swaps execute many more operations and therefore use more gas.

Does the gas limit determine the final fee?

It sets a maximum execution allowance; the final fee is based on gas actually used and effective gas price.

This page provides calculation and research frameworks, not investment, legal or tax advice.