How much does a blockchain transaction cost from gas units and gas price?
A gas fee multiplies computational units by the price paid for each unit, then converts the network token amount into the selected currency using the user-entered token price.
Gas units multiplied by unit price
Total gwei = Base fee + Priority feeFee in token = Gas limit × Total gwei ÷ 1,000,000,000Cost = Fee in token × Token priceFrom network units to a currency fee
The default transaction combines a gas limit or units-used figure with a gas price. The calculation first produces the fee in the network’s native token and then its currency equivalent.
Illustrative inputs; currency amounts below use USD. Rates and prices are assumptions, not live quotes.
- Gas limit
- 21,000
- Base fee (gwei)
- 18
- Priority fee (gwei)
- 2
- Token price
- $3,400.00
Step-by-step calculation
- Fee rate = base 18 + priority 2 = 20 gwei per gas.
- For 21,000 gas, native-token fee = gas × 20 ÷ 1,000,000,000 = 0.00042.
- Currency cost = 0.00042 × 3,400 = 1.428. Actual billing uses gas consumed; an entered gas limit is only a budget estimate.
Intermediate figures are rounded for reading. Results use the full calculation precision.
Separating usage from network price
Gas units describe work; gas price describes the price of that work. Either can raise the final fee, but only gas price usually changes with network demand.
The gwei conversion that causes large errors
Do not mix gwei and whole-token units. A unit-conversion error can inflate the result by orders of magnitude.
- Gas used and gas price are entered in the units shown by the form.
- The native-token price is supplied by the user and remains fixed for the conversion.
- Priority-fee behaviour and refunds are represented only if included by the formula.
Calculations related to gas fee
The following tools examine neighbouring parts of the same calculation without changing the inputs or assumptions used above.
References
Sources and conventions
- Ethereum: gas pricing
Actual transaction cost depends on gas used. The calculator treats your entered gas quantity as an estimate.
Quick answers
Frequently asked questions
What is the difference between gas limit and gas price?
Gas limit is the maximum gas units allowed, while base fee plus priority fee gives the entered price per gas unit.
Why is gwei divided by one billion?
One billion gwei equals one whole native token unit in the formula used here.
Does the calculator use live Ethereum gas prices?
No. Gas values and token price are entered manually.
Calculation method and limitations · Report an error
Educational content only. This guide is not financial advice.
