Crypto gas fee calculator
A blockchain transaction fee can look abstract when the wallet shows gas units and a price in gwei but your budget is recorded in ordinary currency.
Run — free
This calculator connects those values in one transparent computation. Enter the gas used or estimated, the gas price per unit, and the current fiat value of the network's native token. The result reports both the native-token fee and its fiat equivalent, making it useful for checking a wallet estimate, planning a transfer, or comparing transaction timing.
Gather the three values that define the fee
Start with the gas units for the transaction. A completed transaction normally exposes actual gas used in its receipt, while a wallet or application may provide an estimate before submission. Next, enter the gas price in gwei for each unit. Use the effective gas price when reviewing a completed transaction, because that value reflects what was actually charged. For a pending transaction, use the price proposed by the wallet or fee estimator. Finally, enter the fiat price of one whole native token in the currency you care about. All three values must describe the same transaction and point in time if you want a meaningful estimate. This calculator treats the price field as a plain fiat amount, so a value quoted in dollars produces a dollar result, while a value quoted in euros produces a euro result. It does not fetch market data or inspect a blockchain. That keeps the result reproducible and leaves you in control of the assumptions behind it.
Understand the conversion from gwei to fiat
The first step multiplies gas units by the gas price in gwei. Because one gwei is one billionth of a whole native token, the product is divided by one billion to obtain the fee in tokens. The second step multiplies that token fee by the fiat price of one token. For example, a standard transfer using 21,000 gas at 25 gwei consumes 0.000525 native tokens. If one token is worth 3,200 units of your chosen fiat currency, the fee is 1.68 in that currency. The calculator returns the inputs alongside both results so the assumptions remain visible. Token cost is rounded to no more than eighteen decimal places and fiat cost to no more than eight decimal places for stable, readable JSON output. This is arithmetic rounding only; it does not claim that every currency, exchange, wallet, or accounting system supports eight decimal places. Apply your own display or ledger rounding after receiving the result.
Use the result without confusing estimates and final charges
Before broadcasting a transaction, treat the result as a planning figure. Gas estimates can change when contract state changes, and the price paid per unit may differ from an earlier quote. On fee-market networks, wallet interfaces can also show a maximum possible charge that is higher than the effective amount ultimately paid. After confirmation, replace estimated gas and proposed price with the receipt's gas used and effective gas price to reconstruct the final network fee. The fiat figure introduces another timing choice: multiplying by today's token price answers what the fee is worth now, while multiplying by the token price at confirmation answers what it was worth when incurred. Record which convention you use when the number enters bookkeeping or tax records. This capability calculates network gas only. It does not include an exchange spread, bridge charge, application fee, validator tip listed outside the supplied gas price, or token transfer amount. API access costs $0.002 per calculation, while the deterministic formula remains the same for every request.
What you can do with it
Check a wallet estimate
Convert a wallet's proposed gas units and gwei price into a fiat amount before approving the transaction.
Reconcile a confirmed transaction
Use receipt values and a recorded token price to calculate the network fee for bookkeeping.
Compare transaction timing
Evaluate several gas-price scenarios against the same gas estimate and token price to understand the potential savings.
FAQ
What inputs do I need?
You need gas units, the gas price per unit in gwei, and the fiat price of one native token.
What formula does the calculator use?
Token fee equals gas units multiplied by gas price in gwei and divided by one billion. Fiat cost equals that token fee multiplied by the token price.
Does it retrieve live token prices?
No. You supply the token price, so the calculation is deterministic and can use the valuation time and fiat currency you choose.
Should I use the gas limit or gas used?
Use estimated gas for planning before submission. For a confirmed transaction, use actual gas used from the receipt whenever available.
Does the result include every transaction charge?
No. It calculates the gas fee represented by the three supplied values and excludes exchange spreads, bridge fees, application fees, and the transferred amount.
What does an API calculation cost?
Each API request costs $0.002.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/finance/crypto-gas-fee-total \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"gas_units":21000,"gas_price_gwei":25,"token_price_fiat":3200}'const res = await fetch("https://api.kit.forhosting.com/finance/crypto-gas-fee-total", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"gas_units": 21000,
"gas_price_gwei": 25,
"token_price_fiat": 3200
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/finance/crypto-gas-fee-total",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"gas_units": 21000,
"gas_price_gwei": 25,
"token_price_fiat": 3200
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/finance/crypto-gas-fee-total", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"gas_units":21000,"gas_price_gwei":25,"token_price_fiat":3200}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"gas_units":21000,"gas_price_gwei":25,"token_price_fiat":3200}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/finance/crypto-gas-fee-total", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"gas_units": 21000,
"gas_price_gwei": 25,
"token_price_fiat": 3200
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "finance.crypto_gas_fee_total",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |