Crypto Unit Converter

Convert wei, gwei, ether, satoshi and BTC with exact integer maths, so 0.1 ETH is exactly 100000000000000000 wei and 1 wei never shows as 1e-18.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Crypto Unit Converter?

The Crypto Unit Converter moves an amount between the denominations of one chain: wei, kwei, mwei, gwei, szabo, finney and ether on Ethereum, and satoshi, microbitcoin (bits), millibitcoin and bitcoin on Bitcoin. Type an amount, pick the From and To units, and press Convert. The result is printed in full with thousands separators, never in scientific notation.

All the maths happens in your browser on BigInt integers counted in the smallest unit (wei or satoshi). That matters because 1 ether is 10^18 wei, which is past the 2^53 limit where JavaScript numbers stop being exact. A float-based converter turns 1.123456789123456789 ETH into 1123456789123456800 wei; this one returns 1123456789123456789.

It converts units, not currencies. It does not fetch prices and will not turn ETH into BTC or dollars, and it refuses amounts finer than one base unit (half a wei does not exist).

  • Exact BigInt arithmetic, no floating point
  • Seven Ethereum units and four Bitcoin units
  • Full-length output with thousands separators
  • Swap button to reverse a conversion
  • Runs in your browser, no network calls
Read the guide: Ethereum Units and Gas Fees: Wei, Gwei and EIP-1559 Worked Out

Updated

How to use the Crypto Unit Converter

  1. Type the amount in the From box. Plain decimals like 0.1 or 21000 work, and commas are ignored.
  2. Choose Ethereum or Bitcoin in the first From dropdown. The units reset to sensible defaults (ether to wei, or bitcoin to satoshi) when you switch.
  3. Pick the From unit and the To unit.
  4. Press Convert to see the exact result in the To box.
  5. Press Swap to flip the direction; the last result becomes the new input.

Worked examples

A tenth of an ether in wei

Input

0.1 ether to wei

Output

100,000,000,000,000,000

This is the value you would pass as msg.value or in an eth_sendTransaction call. Exactly 17 zeros, with no rounding.

A gas price in ether

Input

21000 gwei to ether

Output

0.000021

21,000 gwei is the fee for a plain 21,000-gas transfer at 1 gwei per gas, which is useful as a mental anchor.

Smallest Bitcoin amount

Input

0.00000001 bitcoin to satoshi

Output

1

Eight decimal places is the most a BTC amount can have. A ninth digit is rejected because it would be a fraction of a satoshi.

Background and insight

Ethereum stores every balance and value as an unsigned integer number of wei. The named units are powers of 1,000: kwei is 10^3 wei, mwei 10^6, gwei 10^9, szabo 10^12, finney 10^15 and ether 10^18. In practice only three survive in daily use: wei in contract code and RPC responses, gwei for gas prices, and ether for balances. ERC-20 tokens follow the same idea with their own decimals field, usually 18, but USDC and USDT use 6, so "1,000,000" of their base units is one token.

Bitcoin works the same way with eight decimals. One satoshi is 10^-8 BTC, so the 21 million coin cap is 2,100,000,000,000,000 satoshi, which still fits in a 64-bit integer. Wallets sometimes show bits (100 satoshi, the same as a microbitcoin) or mBTC (100,000 satoshi). Lightning invoices go below a satoshi using millisatoshi, which is a Lightning accounting unit and is not offered here.

Common use cases

  • Writing contract tests

    Get the exact wei literal for a value in a Foundry or Hardhat test instead of counting zeros by hand.

  • Reading RPC output

    Turn a raw wei balance from eth_getBalance or a log into an ether figure you can sanity-check.

  • Checking gas settings

    Convert a gwei gas price to ether or wei when a script or library expects a different unit.

  • Bitcoin fee and dust maths

    Move between BTC and satoshi when checking outputs, change amounts or dust limits.

Tips and limitations

  • Token amounts are not always 18 decimals. Check the token's decimals() before reusing an ether conversion for USDC (6) or WBTC (8).
  • Avoid passing ether amounts through JavaScript numbers in your own code. Use BigInt, or parseEther and formatEther from ethers or viem.
  • Scientific notation like 1e18 is rejected as input on purpose. Type the digits so nothing is lost in parsing.
  • Cross-chain conversion (ETH to BTC) is disabled because it needs a market price, which this tool does not fetch.

Sources and further reading

  1. Technical intro to ether, Ethereum Foundation. Wei, gwei and ether denominations
  2. Units and Globally Available Variables, Solidity documentation. The wei, gwei and ether literals
  3. ERC-20: Token Standard, Ethereum Improvement Proposals. The decimals field
  4. BIP 176: Bits Denomination, Bitcoin Improvement Proposals. One bit is 100 satoshi

Frequently asked questions

How many wei are in one ether?

One ether is 1,000,000,000,000,000,000 wei, which is 10^18. One gwei is 10^9 wei, so there are a billion gwei in an ether. Contracts and RPC calls always use wei, which is why amounts in code have so many zeros.

Why does my JavaScript code print 0.1 ETH in wei with rounding errors?

Because JavaScript numbers are 64-bit floats that are only exact up to 2^53, about 9 x 10^15, and wei values are routinely larger. Multiplying 0.1 by 1e18 happens to work, but values with many digits get rounded. Use BigInt or a library helper such as parseEther, as this converter does internally.

How many satoshi are in one bitcoin?

One bitcoin is 100,000,000 satoshi, so a satoshi is 0.00000001 BTC. A bit, or microbitcoin, is 100 satoshi and a millibitcoin is 100,000 satoshi. The converter accepts at most eight decimal places for a BTC amount.

What is gwei used for?

Gwei is the unit people use for Ethereum gas prices, because a price per gas unit in wei would be an awkward ten or eleven digit number. A base fee of 15 gwei means 15,000,000,000 wei for every unit of gas the transaction uses.

Can this tool convert ETH to USD or BTC?

No, it only converts between units of the same chain. ETH to BTC or to a fiat currency depends on a live market price, and this page does not fetch prices. Use the result in wei or ether with a price you trust from your own source.

Are szabo and finney still used?

Rarely. Solidity removed the szabo and finney literals in version 0.7.0, leaving wei, gwei and ether. They are kept in the converter because older code, tutorials and test fixtures still mention them: a finney is 10^15 wei and a szabo is 10^12 wei.

Is there an in-depth guide to the Crypto Unit Converter?

Yes. “Ethereum Units and Gas Fees: Wei, Gwei and EIP-1559 Worked Out” covers the background, how it works, common pitfalls and worked examples. Read the full guide.