Wei to ETH Converter
Convert any Ethereum denomination to any other, instantly. Type a value into any field and the rest update with exact big-integer math.
Ethereum units explained
Ether is divisible down to the wei, the smallest unit. Every denomination is just a power of ten of wei, so converting is a matter of shifting the decimal point. Nothing on chain is ever stored as a fraction: the EVM only knows integers, and "1.5 ETH" is really 1500000000000000000 wei with a decimal point drawn in by your wallet.
| Unit | Power | Wei | Common use |
|---|---|---|---|
| wei | 10^0 | 1 | Raw RPC values, contract arithmetic |
| kwei (babbage) | 10^3 | 1,000 | Rarely used |
| mwei (lovelace) | 10^6 | 1,000,000 | Matches USDC's 6 decimals by coincidence |
| gwei (shannon) | 10^9 | 1,000,000,000 | Gas prices, priority fees |
| szabo (microether) | 10^12 | 1,000,000,000,000 | Legacy docs and Solidity |
| finney (milliether) | 10^15 | 1,000,000,000,000,000 | Legacy docs and Solidity |
| ether | 10^18 | 1,000,000,000,000,000,000 | Balances, transfers, UI |
Converting in ethers.js, viem and web3.js
Do not write the multiplication yourself. Every library ships a parse and a format function that take a decimal string and return a bigint, or the other way round, and they handle the awkward cases you will otherwise rediscover one at a time. On BLAZED.sh, ethers.js and web3.js are pre-installed in the script editor, so these run with no setup.
// ethers.js v6
import { parseEther, formatEther, parseUnits, formatUnits } from "ethers";
parseEther("1.5"); // 1500000000000000000n
formatEther(1500000000000000000n); // "1.5"
parseUnits("20", "gwei"); // 20000000000n (a gas price)
formatUnits(20000000000n, "gwei"); // "20.0"
// ERC-20: always read decimals(), never assume 18
const decimals = await token.decimals(); // 6 for USDC
parseUnits("25.50", decimals); // 25500000n// viem
import { parseEther, formatEther, parseGwei } from "viem";
parseEther("1.5"); // 1500000000000000000n
parseGwei("20"); // 20000000000n
// web3.js v4
import { utils } from "web3";
utils.toWei("1.5", "ether"); // "1500000000000000000"
utils.fromWei("1500000000000000000", "ether"); // "1.5"# Python, web3.py
from web3 import Web3
W3 = Web3()
W3.to_wei("1.5", "ether") # 1500000000000000000
W3.from_wei(20000000000, "gwei") # Decimal('20')Three ways the conversion goes wrong
The first is floating point. A JavaScript number carries roughly 15 significant digits and an ether amount needs 18, so the moment a wei value passes through a Number() or a JSON.parse of an unquoted number, the tail is gone. It will look right in testing, because small round amounts survive, and it will be wrong on the first real balance.
The second is token decimals. Wei is a property of ether, not of every token. USDC has six decimals, so 25.50 USDC is 25500000, and code that reuses parseEther for it will try to move a trillion times too much and revert, or worse, succeed in the other direction. Read decimals() once per token and cache it.
The third is the wire format. JSON-RPC returns quantities as minimal hex strings, so a balance comes back as "0x14d1120d7b160000" and not as a decimal. BigInt(hex) is the safe conversion; the hex to decimal converter does the same thing by hand when you are debugging a raw response, and the eth_getBalance reference shows the exact shape of the reply.
Frequently asked questions
How many wei are in 1 ETH?
One ETH equals 1,000,000,000,000,000,000 wei (10^18). Wei is the smallest indivisible unit of ether, named after Wei Dai.
What is gwei used for?
Gwei (10^9 wei) is the unit gas prices are quoted in. A 20 gwei gas price means each unit of gas costs 20 billion wei.
Why use big-integer math instead of floating point?
Ether amounts can exceed the precision of JavaScript floats, which causes rounding errors. This converter uses native BigInt so every conversion is exact.
Why does 0.1 + 0.2 ETH give the wrong answer in my code?
Because you converted to a float somewhere. A JavaScript number holds about 15 significant digits and a wei amount needs up to 18, so the low digits are silently discarded. Keep the value a bigint from the RPC response all the way to the screen and only format it at the last moment.
Do ERC-20 tokens use wei too?
No, and this is the most common source of wrong amounts. Each token declares its own decimals(). USDC and USDT use 6, WBTC uses 8, most others use 18 but none of them have to. Read decimals() from the contract rather than assuming 18, or you will be off by a factor of a trillion.
What are szabo and finney?
Older intermediate denominations, 10^12 and 10^15 wei, named after Nick Szabo and Hal Finney. You will still see them in early documentation and in some Solidity code, though modern tooling mostly sticks to wei, gwei and ether.
Is this converter free and private?
Yes. Everything runs in your browser, nothing is sent to a server, and there is no signup.
Every number here came out of a node
Balances, gas prices and transfer amounts all arrive as hex quantities over JSON-RPC long before anything formats them into ETH. Once your code is reading them on every block rather than by hand, where the node sits matters more than how you print the decimals.
eth_getBalance reference