Encyclopedia Ethereum · Entry 108
Wei and gwei: converting Ethereum amounts and gas prices
In this article
At a glance
Key facts
Keep the units attached to each number
An illustrative operation using 50,000 gas at 12 gwei per gas costs 600,000 gwei, or 0.0006 ETH, for execution gas. The transferred ETH value is a separate field and may be zero.
The gas limit is a maximum allowance for work, not necessarily the gas actually consumed. Use the receipt’s actual gas used for an after-the-fact calculation.
Use integer units when handling exact values
RPC responses commonly encode quantities as hexadecimal integers. Software should preserve the integer value and apply the appropriate display scale instead of passing large wei values through an imprecise floating-point representation.
ERC-20 tokens have their own decimals conventions. A token with six decimals does not become an 18-decimal asset merely because it runs on Ethereum.
Execution gas is not every possible fee
A blob transaction has a separate blob-gas component. Rollup fees can also include components beyond the execution charge visible in a simple mainnet example.
Name the fee component and network before comparing numbers. A bare “12 gwei” does not tell a reader the total amount paid.
Direct answers
Questions people ask
Does a gas price of 20 gwei mean the transaction costs 20 gwei?
No. That is a price per gas unit. The total execution-gas charge depends on how many gas units the transaction consumes and its effective price.
Inspect the evidence
The answer and key facts have stable claim links. These records retain the scope and qualification when reused.
Wei is Ethereum’s smallest ETH denomination: one ETH is 10^18 wei. One gwei is 10^9 wei, so one ETH is one billion gwei. Gas prices are often quoted in gwei per gas; multiply by gas used to calculate the execution-gas fee, then convert the result into ETH.
Scope: Ethereum · data through 2026-10-02. Verification: verified · 2026-10-02T18:12:41.505Z.
Link to this claimWei: 1 ETH = 1,000,000,000,000,000,000 wei.
Scope: Ethereum · data through 2026-10-02. Verification: verified · 2026-10-02T18:12:41.505Z.
Link to this claimGwei: 1 gwei = 1,000,000,000 wei.
Scope: Ethereum · data through 2026-10-02. Verification: verified · 2026-10-02T18:12:41.505Z.
Link to this claimExecution fee: Gas used × effective price per gas gives the execution-gas charge.
Scope: Ethereum · data through 2026-10-02. Verification: verified · 2026-10-02T18:12:41.505Z.
Link to this claimRevision history
- — First publication after primary-source research and independent automated verification.
Source register
Sources and references
Retrieval dates and locators are recorded individually.- Gas and feesethereum.org contributors
Execution resource units, fee components and gas expenditure.
Locator: What is gas?; Base fee; Priority fee · Retrieved: 2026-10-02T17:03:41.688ZOpen source - Ethereum accountsethereum.org contributors
Key-controlled and code-controlled accounts, balances, nonces and storage.
Locator: Account types; An account examined; Account creation · Retrieved: 2026-10-02T17:03:41.958ZOpen source - Fee market change for ETH 1.0 chainEthereum Improvement Proposals
Base fees, fee caps, priority fees and effective transaction gas price.
Locator: Specification · Version / scope: EIP/ERC-1559; retrieved document hash recorded · Retrieved: 2026-10-02T17:03:42.151ZOpen source - Ethereum JSON-RPCethereum.org contributors
RPC response fields, transaction receipts, call simulation and log filtering.
Locator: eth_getTransactionByHash; eth_getTransactionReceipt; eth_call; eth_getLogs; eth_getCode; eth_estimateGas; eth_getBalance; eth_getStorageAt; eth_getTransactionCount; default block parameter · Retrieved: 2026-10-02T17:03:42.060ZOpen source - ERC-20 Token StandardEthereum Improvement Proposals
Token supply, displayed units and balance accounting.
Locator: totalSupply; balanceOf; transfer; decimals; approve; allowance; transferFrom; Transfer · Version / scope: ERC-20 · Retrieved: 2026-10-02T17:03:45.826ZOpen source - Shard Blob TransactionsEthereum Improvement Proposals
Blob commitments, separate blob-gas fee calculations and temporary data availability.
Locator: Gas accounting; Opcode to get versioned hashes; Point evaluation precompile; Consensus layer validation · Version / scope: EIP/ERC-4844; retrieved document hash recorded · Retrieved: 2026-10-02T17:03:42.506ZOpen source - OP Stack transaction feesOptimism
Rollup execution, data-publication and operator fee components depend on active network upgrades.
Locator: Gas fee components; Execution gas fee; L1 data fee; Operator fee · Retrieved: 2026-10-02T17:55:17.901ZOpen source
Research and drafting use AI assistance. A separate automated review checks claims against primary sources; no external expert or named human review is implied. Publication, substantive editing, source retrieval and verification are recorded separately. This version was independently checked by an automated reviewer on 2 October 2026.
Editorial method and correctionsDegrees of Satoshi editorial project. “Wei and gwei: converting Ethereum amounts and gas prices.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/wei-and-gwei/