Ethereumwei, Gwei and ETH, converted with exact integer arithmetic

Gwei Converter

Type into any of the three fields and the other two follow. Every conversion runs through wei as a BigInt, so all 18 decimals survive the round trip instead of being flattened by floating point.

Convert
One field per unit. The field you type in stays exactly as you wrote it.
Try:
In wei
1000000000
The three units
Same currency, three scales, fixed by the protocol.
wei

The smallest unit and the only one the EVM works in. Balances, transaction values and gas prices are all integers in wei; there is nothing below it, so no rounding happens at the protocol level.

Gwei

109 wei, also written as nanoether. Gas prices land in this range, which is the whole reason the unit is in daily use: 20 Gwei reads better than 20000000000 wei and than 0.00000002 ETH.

ETH

1018 wei. What users see in a wallet, and the unit almost no interface actually computes in.

Read the live gas price from an API

7 days of testing, no credit card, no KYC.

Start the free trial

The three units, and the arithmetic between them

Ethereum has one currency and several names for its scales. Two of them matter in practice:

Unit In wei In ETH Also called
wei 1 0.000000000000000001
Gwei 1,000,000,000 0.000000001 nanoether, shannon
ETH 1,000,000,000,000,000,000 1 ether

Converting is a decimal shift, not a multiplication you need a library for. Gwei to ETH moves the point nine places left, ETH to wei moves it eighteen places right. Doing it by hand is where the mistakes come from: nine zeros and eighteen zeros look alike at a glance, and an off-by-three error turns a 20 Gwei gas price into 20 megawei.

Why Gwei exists at all

The EVM has no fractional type. Balances, transaction values and gas prices are all unsigned integers in wei, because integers are the only thing consensus can agree on exactly. That decision is correct and it makes gas prices unreadable: a normal price is a ten- or eleven-digit number in wei, and a five-decimal fraction in ETH. Neither scale fits the number.

Gwei sits between them, at 109 wei, and gas prices land in single or double digits there. That is the entire reason the unit is in daily use. It is not a separate token, not a Layer-2 denomination, just a scale that happens to match the size of the numbers people quote. The names shannon and nanoether refer to the same thing and rarely appear outside unit tables.

The same logic runs the other way for balances. Nobody quotes a wallet in wei, and nobody quotes a gas price in ETH. Each scale is used where its numbers have a readable number of digits, which is why an interface that touches both keeps converting between them.

Why this converter uses BigInt

A JavaScript number is a double, exact for integers only up to 253 − 1, which is 9,007,199,254,740,991. That is roughly 9 × 1015, short of the 1018 wei in a single ETH. Past that limit the results are silently wrong rather than rejected:

1.1 * 1e18            // 1100000000000000100  — off by 100 wei
Number("1234567890123456789")
                      // 1234567890123456800  — last two digits lost
0.1 + 0.2             // 0.30000000000000004

None of those throw. They return a plausible-looking number with the low digits replaced by whatever the binary representation happened to land on. In a converter that is bad; in code that constructs a transaction value it is a bug you find in production, when a transfer moves a slightly different amount than the one displayed.

The fix is to never let a wei value become a float. This page parses your input as a decimal string, shifts the point by string manipulation, and holds the result as a BigInt. Typing 18 arbitrary decimals into the ETH field returns exactly those digits in the wei field. The one place where digits are dropped is when you enter more decimals than the unit has, and the page says so instead of rounding quietly.

The same discipline applies in your own code. ethers has parseEther and formatUnits, viem has parseEther and formatGwei, and both return BigInt values for the same reason. A hand-rolled value / 1e18 works right up to the amount where it does not.

Gas cost in the three units

Gas is where the conversion actually gets used, so it helps to see one calculation in all three scales. A plain ETH transfer costs a fixed 21,000 gas. At a gas price of 20 Gwei:

21000 gas × 20 Gwei  = 420,000 Gwei
                     = 420,000,000,000,000 wei
                     = 0.00042 ETH

The gas amount depends on what the transaction does; the gas price depends on demand for block space at that moment. Since EIP-1559 the price splits into a base fee, which is burned, and a priority fee, which goes to the block proposer. Both are quoted per gas, and both are wei values under the hood, which is why the Chaingateway transaction parameters gasprice, maxFeePerGas and maxPriorityFeePerGas take an example value of 1000000000 rather than 1. That is one Gwei written out in wei.

Watch the scale when you read a price back: GET /api/v2/ethereum/gasprice returns a single gasPrice field whose example value in the reference is 12.28, a Gwei-scale figure rather than a wei integer. Sending it straight back into a transaction as gasprice would ask for 12 wei per gas. Convert first, then multiply by the gas your transaction uses.

The rest of the Ethereum endpoints, including ERC-20 transfers and transaction webhooks, are described on the Ethereum API page. Related calculators sit under Tools.

Questions

How many wei are in one ETH?

1018, that is 1,000,000,000,000,000,000 wei. The exponent is fixed by the protocol and has never changed.

How many wei are in one Gwei?

109, that is 1,000,000,000 wei. One ETH holds 109 Gwei, so Gwei sits exactly halfway between wei and ETH on a logarithmic scale.

How do I convert wei to ETH by hand?

Move the decimal point eighteen places to the left, padding with zeros if the number is shorter than nineteen digits. 420,000,000,000,000 wei becomes 0.00042 ETH. Gwei to ETH is the same operation with nine places.

Is Gwei the same as nanoether?

Yes. Gwei, nanoether and shannon are three names for 109 wei, which is 10−9 ETH. Gwei is the name that stuck, because gas prices are usually quoted in it.

Why is Gwei used for gas prices instead of ETH?

Digit count. A gas price of 20 Gwei is 20,000,000,000 wei or 0.00000002 ETH, and neither of those is readable at a glance. Gwei puts normal gas prices into single or double digits.

Can I convert wei to ETH with a normal JavaScript number?

Not reliably. A double is exact for integers only up to 9,007,199,254,740,991, well below the 1018 wei in one ETH, so larger values lose their low digits without any error being raised. 1.1 * 1e18 returns 1100000000000000100, a hundred wei off. Use BigInt, or a library that returns BigInt.

What does a transaction cost in ETH if the gas price is in Gwei?

Multiply the gas used by the gas price, then convert. A plain transfer uses 21,000 gas; at 20 Gwei that is 420,000 Gwei, which is 0.00042 ETH. Contract calls use more gas, and the 21,000 figure is the floor rather than a typical value.

Does this converter round?

No. Every value is parsed as a decimal string and held as a BigInt in wei, so all 18 decimals survive. The only case where digits are dropped is an input with more decimal places than the unit has, such as a fraction in the wei field, and the page reports that instead of rounding silently.