Every Ethereum transaction involves a fee — commonly called a "gas fee" — that must be paid in ETH. But if you've looked at your MetaMask wallet or a block explorer, you've seen these fees quoted in "Gwei" rather than ETH. And if you've ever received a tiny amount of ETH or examined a smart contract's internal workings, you may have encountered "Wei." Understanding the relationship between these units is essential for anyone interacting with the Ethereum network.
Ethereum's Denomination Table
Ethereum uses a hierarchical denomination system similar to the dollar/cent relationship, but with many more intermediate units. The base unit is Wei — the smallest indivisible unit of Ether.
| Unit | Wei Value | ETH Value | Common Use |
|---|---|---|---|
| Wei | 1 | 0.000000000000000001 ETH | Smart contracts, internal accounting |
| Kwei (Babbage) | 1,000 | 10⁻¹⁵ ETH | Rare |
| Mwei (Lovelace) | 1,000,000 | 10⁻¹² ETH | Rare |
| Gwei (Shannon) | 1,000,000,000 | 0.000000001 ETH | Gas prices |
| Szabo | 1,000,000,000,000 | 0.000001 ETH | Rare |
| Finney | 10¹⁵ | 0.001 ETH | Micropayments |
| Ether (ETH) | 10¹⁸ | 1 ETH | Display, trading, pricing |
The key takeaway: 1 ETH = 1,000,000,000 Gwei = 1,000,000,000,000,000,000 Wei.
The intermediate units (Kwei, Mwei, Szabo, Finney) are named after computing and cryptography pioneers: Charles Babbage, Ada Lovelace, Claude Shannon, Nick Szabo, and Hal Finney.
Why Gwei Matters for Gas
Gas fees are the cost of computational work on the Ethereum network. Every operation — sending ETH, interacting with a smart contract, minting an NFT — consumes a specific amount of "gas units." The user pays for those gas units at a rate specified in Gwei.
Gwei is used for gas pricing because:
- Gas prices are typically in the range of 1–200 Gwei
- Expressing the same values in ETH (0.000000001 to 0.0000002 ETH) is unwieldy
- Expressing in Wei (1,000,000,000 to 200,000,000,000) is equally impractical
Gwei (billion-Wei) hits the sweet spot: human-readable numbers for typical network conditions.
The Gas Fee Formula
Your transaction's total gas cost is:
Gas Fee (ETH) = Gas Units Used × Gas Price (Gwei) ÷ 1,000,000,000
Since EIP-1559 (August 2021), the gas fee has two components:
Total Fee = (Base Fee + Priority Fee) × Gas Units Used
- Base Fee: The minimum required fee, set algorithmically by the network and burned (destroyed)
- Priority Fee (tip): An optional additional payment to incentivize validators to include your transaction faster
Example:
- Gas units for a simple ETH transfer: 21,000
- Base fee: 15 Gwei
- Priority fee: 2 Gwei
- Total gas price: 17 Gwei
Gas fee = 21,000 × 17 Gwei = 357,000 Gwei
= 357,000 ÷ 1,000,000,000 ETH
= 0.000357 ETH
At ETH price of $3,000: $1.07 per transfer.
Typical Gas Costs by Transaction Type
Gas usage varies by transaction complexity — simple ETH transfers use the least, complex smart contract interactions use the most.
| Transaction Type | Gas Units | Cost at 20 Gwei | Cost at 100 Gwei |
|---|---|---|---|
| ETH transfer | 21,000 | 0.00042 ETH | 0.0021 ETH |
| ERC-20 token transfer | 45,000–65,000 | 0.0013 ETH | 0.0065 ETH |
| Uniswap token swap | 100,000–150,000 | 0.003 ETH | 0.015 ETH |
| NFT mint | 100,000–250,000 | 0.005 ETH | 0.025 ETH |
| Complex DeFi interaction | 200,000–500,000+ | 0.01 ETH | 0.05 ETH |
At ETH = $3,000, a Uniswap swap at 100 Gwei costs approximately $45 — a significant cost that makes small trades economically unviable.
Tips to Reduce Gas Fees
Monitor gas prices and time transactions. Gas prices follow predictable patterns — weekday US business hours are expensive; late nights and weekends (UTC) are cheaper. Tools like EthGasStation, Blocknative, and the Etherscan gas tracker show real-time and historical gas prices.
Set a gas limit, not just a gas price. The gas limit is your maximum gas units authorization. Setting it too low causes transaction failure (you still pay gas for the failed computation). Setting it correctly ensures success. MetaMask estimates this automatically.
Use Layer 2 networks. Arbitrum, Optimism, Polygon, and Base offer Ethereum-compatible transactions at 1–10% of mainnet gas costs. For routine transfers and DeFi interactions, L2s make economic sense for amounts under $1,000–$5,000.
Batch transactions. Some protocols allow multiple actions in a single transaction, sharing the fixed base overhead. This is particularly relevant for NFT batch minting or multi-token approval patterns.
Priority fee optimization. During low-congestion periods, a priority fee of 0.1–0.5 Gwei is sufficient to get included in the next block. Only increase it when you need fast confirmation.
Developer Use Cases
In Ethereum smart contracts, all value is handled in Wei to avoid floating-point arithmetic errors. Solidity (the primary smart contract language) doesn't support decimals, so:
// Sending 0.1 ETH in a contract
uint256 amount = 0.1 ether; // = 100,000,000,000,000,000 Wei
The ether keyword in Solidity is a convenience multiplier (×10¹⁸). Contract developers must be careful to convert user-facing ETH amounts to Wei before comparison or arithmetic, and convert Wei back to ETH for display.
This unit system — while confusing at first — prevents an entire class of rounding errors that would be catastrophic in financial contracts moving millions of dollars in value.