Online Tool Store Online Tool Store

Random Secret Key Generator

Generate cryptographically secure keys with adjustable byte length in hex, Base64, or URL-safe Base64 formats for APIs and application secrets.

🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.

Generated using your browser's cryptographically secure random number generator. Never share a secret key publicly or commit it to version control.

How the random secret key generator works

  1. Choose a format - hex, Base64, or URL-safe Base64.
  2. Pick a key length in bytes.
  3. Copy the generated key, created using a cryptographically secure random source.

FAQ

How random is the generated key?

It uses the Web Crypto API's crypto.getRandomValues(), a cryptographically secure random number generator suitable for generating secrets, API keys, and encryption keys - not Math.random().

What format should I choose?

Hexadecimal is common for API keys and tokens. Base64 is more compact and common in JWTs and config files. Base64 URL-safe avoids characters that need escaping in URLs.

What key length should I use?

32 bytes (256-bit) is a solid default for most secrets like session keys or API tokens. Use 16 bytes (128-bit) for less critical uses, or 48-64 bytes for extra-high-security applications.

Is the key ever sent anywhere?

No - it's generated and displayed entirely in your browser. Nothing is transmitted or logged.

Where should I store the key once I've generated it?

Treat it like a password: put it in a secrets manager or environment variable, not in source control, a chat message, or an unencrypted file.

How we compare

FeatureOnline Tool StoreTyping a password yourselfCommand-line openssl rand
Cryptographically secure randomness
No terminal required
Multiple output formats

Useful for quickly generating a strong API key, session secret, or encryption key during development.

Explore related tools

Embed this tool

Paste this on your own site — it stays free, and every file still stays in your visitor's browser, not yours or ours.