OpenSSL Password Generator
Generate a random value equivalent to OpenSSL's rand command. Choose base64 or hex output and the number of random bytes.
Equivalent command:
openssl rand -base64 32Recommended Settings
Pro Tips
- •This produces the same style of output as running openssl rand locally, using your browser's cryptographically secure random number generator instead of OpenSSL's
- •Base64 encoding is more compact (fewer characters for the same number of random bytes) while hex is easier to read and universally compatible
- •32 random bytes is a common choice for encryption keys and high-entropy secrets - smaller values suit tokens or IDs where extreme length isn't needed
- •This is a drop-in browser alternative when you need OpenSSL-style random output but don't have a terminal handy
Most Popular
Most users generate 32 bytes in base64 format, matching a common openssl rand -base64 32 command
When to Use This Tool
Generate a random secret value for an environment variable without needing a terminal.
Generate raw random bytes suitable for use as a symmetric encryption key.
Create a random token for API authentication or one-time use links.
Get OpenSSL-equivalent random output when you don't have immediate terminal access.
How It Works
Generate the requested number of cryptographically secure random bytes using the Web Crypto API
Encode those bytes as either base64 or hexadecimal, matching the output format of the equivalent openssl rand command
100% Private
Files never leave your device. All processing happens locally in your browser.
Lightning Fast
Powered by Web Crypto API (crypto.getRandomValues) for optimal performance on modern browsers.
Open Source
Built with verified, open-source libraries. Fully transparent.
Frequently Asked Questions
Is this as secure as running openssl rand?
Yes. Both this tool and OpenSSL rely on cryptographically secure random number generation. This tool uses the Web Crypto API's crypto.getRandomValues, which is designed for cryptographic use, just like OpenSSL's random byte generator.
What's the difference between base64 and hex output?
Base64 encodes the same random bytes into fewer characters (more compact), while hex uses exactly two characters per byte and is easier to read or type manually. Both represent the same amount of underlying randomness.
How many bytes should I use?
32 bytes (256 bits) is a common, secure choice for encryption keys and high-value secrets. Shorter values like 16 bytes are often sufficient for tokens or session identifiers.
Is my generated value sent to a server?
No. The value is generated entirely locally in your browser using JavaScript. It's never transmitted anywhere, including to this website's own servers.
Can I generate a base64 value with URL-safe characters?
This tool uses standard base64 encoding, which can include + and / characters that aren't URL-safe. If you need a URL-safe token, use the hex format instead, or manually replace those characters.