Free · Private · Client-side

OpenSSL rand -hex 32 Generator

Generate the same kind of random hexadecimal string that openssl rand -hex 32 prints in a terminal: 16, 32 or 64 cryptographically random bytes encoded as hex, created in your browser.

Generated values never leave this device.
64 chars, 0-9 a-f
Estimated entropy: 256 bits · 32 random bytes~132,943,112,026,157,700,000,000,000,000 quintillion times the age of the universe to crack
Weak · <50 bitsFairGood · 70+Strong · 100+

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

Strong256 bits
Strong256 bits
Strong256 bits
Strong256 bits
Strong256 bits

The matching OpenSSL commands

Both commands read 32 random bytes from OpenSSL's CSPRNG. The only difference is how those bytes are printed: hex gives 64 characters, Base64 gives 44.

32 bytes as 64 hex characters

$openssl rand -hex 32

32 bytes as 44 Base64 characters

$openssl rand -base64 32

Python equivalent

$python3 -c "import secrets; print(secrets.token_hex(32))"

Node.js equivalent

$node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

What openssl rand -hex 32 does

  • rand asks OpenSSL for cryptographically secure random bytes
  • 32 is the number of bytes, not characters — 32 bytes is 256 bits of entropy
  • -hex prints each byte as two hexadecimal digits, so you get a 64-character string
  • -base64 prints the same bytes as Base64 instead, a shorter string that can contain +, / and =
  • Need a different length? openssl rand -hex 16 gives 32 characters (128 bits) and openssl rand -hex 64 gives 128 characters (512 bits)

Common Uses

.env
# Any secret that wants a random hex value
SECRET_KEY=...

# Encryption key (32 bytes = AES-256)
ENCRYPTION_KEY=...

# Webhook or signing secret
WEBHOOK_SECRET=...

Hex or Base64?

  • Hex is safe to paste anywhere: only 0-9 and a-f, no symbols to escape in shells, URLs or config files
  • Base64 is about a third shorter but can include +, / and =
  • Pick by what the receiving software expects — the entropy is identical for the same byte count

Bulk Generation

hex strings