Wei, Gwei, and Ether: A Complete Guide to Ethereum Unit Conversions
Ethereum uses 18 decimal places and a hierarchy of named denominations from wei to ether. Here's the full conversion table, the history behind the names, and how to convert between units without losing precision.
Ethereum's currency system is built on a single principle: one ether is divisible into one quintillion smaller units. That number — 10 to the 18th power, or 1,000,000,000,000,000,000 — defines the precision of every transaction, every smart contract balance, and every gas fee calculation on the Ethereum network. The smallest unit is called wei, the most commonly used intermediate unit is gwei, and the standard unit is ether (ETH). Between them sits a hierarchy of named denominations, most of which are rarely used but all of which are part of the Ethereum specification.
This article provides the complete Ethereum denomination table, explains the historical naming conventions, covers the practical conversions you'll actually use, and addresses the precision challenges that trip up developers.
The Complete Denomination Table
Ethereum defines a series of named units, each representing a power of 10 from 1 (wei) to 10 to the 18th (ether). The names honor pioneers in computing, cryptography, and related fields.
Wei (1 wei, 10 to the 0) is the smallest possible unit. Named after Wei Dai, the cryptographer who published the b-money proposal in 1998 — one of the direct intellectual precursors to Bitcoin.
Kwei (1,000 wei, 10 to the 3), also called babbage. Named after Charles Babbage, the 19th-century mathematician and inventor who designed the Analytical Engine, considered the first general-purpose computer.
Mwei (1,000,000 wei, 10 to the 6), also called lovelace. Named after Ada Lovelace, who wrote the first algorithm intended to be executed by a machine (Babbage's Analytical Engine) and is widely regarded as the first computer programmer.
Gwei (1,000,000,000 wei, 10 to the 9), also called shannon. Named after Claude Shannon, the mathematician and electrical engineer who founded information theory. Gwei is the standard denomination for gas prices — when you see "20 gwei" as a gas price, that means 20 billion wei per unit of gas.
Microether (1,000,000,000,000 wei, 10 to the 12), also called szabo. Named after Nick Szabo, the computer scientist and legal scholar who developed the concept of smart contracts and designed Bit Gold, another precursor to Bitcoin.
Milliether (1,000,000,000,000,000 wei, 10 to the 15), also called finney. Named after Hal Finney, the cryptographer and programmer who received the first-ever Bitcoin transaction from Satoshi Nakamoto and was one of Bitcoin's earliest supporters and developers.
Ether (1,000,000,000,000,000,000 wei, 10 to the 18) is the standard unit used for pricing and display. Named denominations above ether (kether, mether, gether, tether) exist in theory but are never used in practice.
The Conversions You Actually Need
In daily Ethereum use, you need exactly two conversions regularly: wei to gwei (for gas prices) and wei to ether (for account balances and transaction values). Everything else is academic.
Wei to gwei: divide by 1,000,000,000 (10 to the 9th). A gas price of 20,000,000,000 wei is 20 gwei. Our wei-to-gwei converter does this instantly.
Wei to ether: divide by 1,000,000,000,000,000,000 (10 to the 18th). A balance of 1,500,000,000,000,000,000 wei is 1.5 ETH.
Gwei to ether: divide by 1,000,000,000 (10 to the 9th). A gas price of 20 gwei is 0.00000002 ETH.
Ether to wei: multiply by 10 to the 18th. Sending 0.5 ETH means sending 500,000,000,000,000,000 wei.
Our Ethereum unit converter handles all of these conversions and includes every named denomination in the Ethereum spec.
Where You Encounter Each Unit
Wei appears in smart contract code, raw RPC responses, and blockchain explorers' "raw" views. When you call a smart contract function that returns an ETH balance, the return value is in wei. When you query an Ethereum node's JSON-RPC API for an account balance, the response is in wei (encoded as a hexadecimal string). When Etherscan shows the "value" field of a transaction in its raw view, it's in wei.
Gwei appears in gas price displays and fee estimates. MetaMask, Etherscan's gas tracker, and other gas estimation tools display gas prices in gwei. This convention exists because gas prices in wei are inconveniently large numbers (20 billion wei doesn't communicate as clearly as 20 gwei) and gas prices in ether are inconveniently small numbers (0.00000002 ETH is hard to read and compare).
Ether appears in wallet balances, transaction amounts, exchange prices, and portfolio tracking. This is the unit humans think in — "I have 2.5 ETH" is meaningful in a way that "I have 2,500,000,000,000,000,000 wei" is not. Exchanges price ETH against fiat currencies and other cryptocurrencies in whole and fractional ether.
Gas Fee Calculations in Practice
Gas fees are where the denomination system matters most to everyday users. Understanding how gas prices (in gwei) translate to actual costs (in ether and dollars) prevents overpaying and helps with transaction timing.
The formula is: total fee equals gas units used multiplied by gas price in gwei, divided by 1,000,000,000 (to convert from gwei to ether). Under EIP-1559, the gas price is the sum of the base fee and the priority fee (tip), both denominated in gwei.
For a basic ETH transfer using 21,000 gas at a gas price of 25 gwei: 21,000 multiplied by 25 equals 525,000 gwei, which equals 0.000525 ether. At an ETH price of 3,000 dollars, that's about 1.58 dollars.
Our gas fee calculator performs this calculation automatically, including the dollar conversion. For a deeper explanation of how gas fees work under EIP-1559, including the base fee, priority fee, and max fee mechanism, see our article on Ethereum gas fees explained.
Precision and Developer Pitfalls
Working with Ethereum's 18-decimal system requires careful attention to numeric precision, especially in JavaScript and other languages with limited integer precision.
The JavaScript problem. JavaScript's Number type uses IEEE 754 double-precision floating-point, which can represent integers exactly only up to 2 to the 53rd power — approximately 9.007 times 10 to the 15th. One ether in wei is 10 to the 18th — about 111 times larger than JavaScript's safe integer limit. This means that even moderately large ETH amounts (anything over about 9,007 ETH) will lose precision if stored as a JavaScript Number.
The solution is BigInt, natively supported in modern JavaScript and TypeScript. Libraries like ethers.js (version 6 and later) return all values as BigInt by default. Older code using web3.js or ethers.js v5 may use BN.js or BigNumber.js — dedicated arbitrary-precision integer libraries that avoid the floating-point limitation.
String representation. When transmitting Ethereum values over JSON-RPC or storing them in databases, the safest approach is to use strings. A wei value stored as the string "1500000000000000000" is exactly 1.5 ETH, with no precision loss. Converting to a JavaScript Number for display is fine; converting to a Number for arithmetic is dangerous.
Hex encoding. Ethereum RPC responses encode wei values as hexadecimal strings prefixed with 0x. The value 0x14d1120d7b160000 represents 1,500,000,000,000,000,000 wei (1.5 ETH). Our hex-decimal converter translates between hex and decimal representations. When building transactions programmatically, you typically need to convert from a human-readable ether amount to wei (multiply by 10 to the 18th) and then to a hex string for the RPC call.
Rounding in display. When converting wei to ether for display, it's common to truncate to a reasonable number of decimal places — typically 4 to 6 for wallet balances, 2 to 4 for transaction amounts, and 0 to 2 for gas prices in gwei. The key rule: truncate for display only, never for calculations. All arithmetic should operate on the full-precision wei value.
Cross-Denomination Comparisons
Understanding relative denomination sizes across blockchains helps when working in multi-chain environments.
One satoshi (Bitcoin's smallest unit) is equivalent in magnitude to 10,000,000,000 wei (10 to the 10th wei). This doesn't mean they're worth the same — their dollar values depend on the prices of BTC and ETH — but it illustrates that Bitcoin's base unit is ten billion times coarser than Ethereum's.
One lamport (Solana's smallest unit) is equivalent in magnitude to 1,000,000,000 wei (10 to the 9th wei, or 1 gwei). Again, the dollar values differ, but the precision relationship is that Ethereum is one billion times more granular than Solana.
These precision differences matter for cross-chain operations. Bridging a token from Ethereum (18 decimals) to Solana (9 decimals) may require truncating precision. An amount expressible exactly in wei may not be expressible exactly in lamports. For a broader discussion of denomination systems across chains, see our article on satoshis, lamports, and token decimals.
Historical Context: Why These Names?
The Ethereum denomination names were chosen by the early Ethereum community to honor individuals whose work contributed to the intellectual foundations of cryptocurrency and distributed computing. The naming convention follows a rough chronological order from the smallest to the largest unit.
Wei Dai (wei) is the earliest intellectual ancestor acknowledged in the naming — his b-money paper from 1998 described a system for anonymous electronic cash using computational puzzles. Charles Babbage (babbage/kwei) and Ada Lovelace (lovelace/mwei) represent the origins of computing itself. Claude Shannon (shannon/gwei) represents information theory, which underpins all digital communication and cryptography. Nick Szabo (szabo/microether) represents the smart contract concept that is central to Ethereum's purpose. And Hal Finney (finney/milliether) represents the earliest practical implementation of cryptocurrency.
The naming scheme is a deliberate statement about Ethereum's intellectual heritage — connecting a 21st-century blockchain platform to a lineage of thought stretching back to the 19th century.
The Bottom Line
Ethereum's denomination system is designed for maximum precision: 18 decimal places from wei to ether, with named intermediate units that are rarely used outside of gwei. In practice, you need to know three conversions: wei to ether for balances, wei to gwei for gas prices, and the hex encoding used by RPC calls. The critical developer rule is to never use floating-point arithmetic for wei values — use BigInt, string representations, or arbitrary-precision libraries. Our Ethereum unit converter, wei-to-gwei converter, and gas fee calculator make these conversions instant and error-free.
References
Ethereum.org — Gas and Fees — Official documentation including denomination definitions.
Eth-Converter.com — Comprehensive Ethereum unit conversion reference with denomination history.
Alchemy — Calculate and Convert Wei, Gwei, and ETH — Developer-focused conversion tool with explanations.
CryptoJobsList — Ethereum Unit Converter — Conversion tool with denomination reference table.
Coin Guides — Gwei to Ether — Visual conversion guide with denomination breakdown.