Random Hex Generator
Generate cryptographically secure random hexadecimal strings, 32-char and 64-char hex keys, salts, and byte sequences locally in your browser using the Web Crypto API.
In plain terms: a gaming PC guessing a million passwords per second would need 132,943,112,026,157,700,000,000,000,000,000,000 quintillion times the age of the universe. Even someone renting every cloud server on Earth — a trillion guesses per second — would need 132,943,112,026,157,700,000,000,000,000 quintillion times the age of the universe. Nobody is guessing this password; the only realistic risks are it being reused or phished.
Generated hex strings
Hex Length Quick Reference
| Hex Chars | Bytes | Entropy | Common Use |
|---|---|---|---|
| 16 chars | 8 bytes | 64 bits | Short nonces, trace IDs, correlation tokens |
| 32 chars | 16 bytes | 128 bits | AES-128 keys, cryptographic salts, UUID hex |
| 64 chars | 32 bytes | 256 bits | AES-256 keys, HMAC-SHA256 secrets, API/CSRF tokens |
| 128 chars | 64 bytes | 512 bits | HMAC-SHA512 secrets, JWT HS512, RFC 8784 PPKs |
Generate Random Hex in CLI & Code
Generate 64 random hex characters (32 bytes) with OpenSSL
openssl rand -hex 32Generate cryptographically secure hex in Python 3
python3 -c "import secrets; print(secrets.token_hex(32))"Generate random hex in Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"// Browser / Web Crypto API (zero dependencies)
const bytes = new Uint8Array(32)
crypto.getRandomValues(bytes)
const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('')
console.log(hex) // 64 lowercase hex characters (256 bits)Related Generators
1 hex character = 4 bits of entropy
Every two hexadecimal characters (0–9, a–f) represent one random byte (8 bits). A 64-character hex string equals 32 random bytes (256 bits)—the standard size for AES-256 keys, HMAC-SHA256 secrets, and API tokens. Need the exact OpenSSL CLI equivalent? Try openssl rand -hex 32 or openssl rand -base64 32.