Private Key to Address
Convert private key to Ethereum address
⚠️
Security Warning
- Never share your private key with anyone
- Never enter your real private key on websites
- This tool runs locally in your browser
- Use only for testing and development purposes
How it works: The Ethereum address is derived from the private key using elliptic curve cryptography (secp256k1). The public key is computed from the private key, then hashed with Keccak-256, and the last 20 bytes form the address.
1. What is a Private Key?
A private key is a 256-bit (32-byte) random number that gives you control over an Ethereum account. Anyone with access to the private key has full control over the associated address and funds.
2. How does it work?
Address Derivation
The Ethereum address is derived from the private key in several steps: (1) Generate public key using ECDSA on secp256k1 curve, (2) Hash the public key with Keccak-256, (3) Take the last 20 bytes as the address.
Security Best Practices
- Never share your private key
- Store private keys securely (hardware wallet, encrypted storage)
- Never enter real private keys on websites
- Use this tool only for testing/development
3. Examples
Example conversion
Private Key (32 bytes) → Public Address (20 bytes, checksummed)4. Source Code
typescript
1// npm install viem
2
3import { privateKeyToAddress, privateKeyToAccount } from 'viem/accounts';
4
5// Convert private key to address
6const privateKey = "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef";
7const address = privateKeyToAddress(privateKey as `0x${string}`);
8console.log("Address:", address);
9// Example: 0xb67C268fAC7C2Fba5eD461C8085008D75F5Db8A7
10