UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

Free eBooks·About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeSecuritySecret Key Generator

Related Tools

Password GeneratorPassword StrengthPassphrase GeneratorEntropy CalculatorAPI Key GeneratorPIN GeneratorPassword CheckerUUID v5CSRF Token Generator

Cryptographic Secret Key Generator

Generate 128–512-bit cryptographic secret keys in hex, Base64, Base64URL, or Base58 using crypto.getRandomValues. Batch up to 20 keys at once.

You Might Also Like

All Security

Password Generator

Generate cryptographically strong random passwords with custom length, symbols, numbers and uppercase options. Nothing is sent to any server.

Password Strength

Score a password against what crackers actually try — wordlists, keyboard walks, leet spelling, dates — and see how long four attacks would take.

Passphrase Generator

Generate memorable passphrases using crypto.getRandomValues. 3–10 words, 5 separator styles, capitalize & digit options. Live entropy meter.

Entropy Calculator

Calculate password entropy in bits from a real password or a length-and-character-set policy, then compare crack times across four attack speeds.

Every JWT secret, AES session key, HMAC signing key, and OAuth client secret starts the same way: a block of random bytes pulled from the operating system's cryptographic RNG. This tool exposes that primitive directly, with no server and no account, so you can generate production-quality keys in the format your stack expects without reaching for a terminal.

Pick a bit length (128, 192, 256, 384, or 512), choose an encoding, set the batch size (1 to 20), and every value is generated fresh by crypto.getRandomValues. Click Regenerate at any time to get a new set. Each key has its own Copy button, and Copy all appears when you generate a batch of two or more.

The Controls: Bit Length and Encoding

  • 128-bit — 16 bytes. Minimum for AES-128 and most HMAC-SHA-256 use cases. Sufficient entropy for a session token but short enough to paste comfortably.
  • 256-bit — 32 bytes. The standard choice for AES-256, JWT HS256 secrets, and general-purpose API keys. Recommended default.
  • 384 / 512-bit — 48/64 bytes. Required for HMAC-SHA-384 and HMAC-SHA-512 respectively, and used in high-assurance contexts where the key must outlive current computational assumptions.
  • Hex: lowercase hexadecimal, two characters per byte. Universally accepted in config files and environment variables. A 256-bit key produces 64 characters.
  • Base64: RFC 4648 standard encoding with +, /, and = padding. Used in HTTP headers, PEM files, and many backend frameworks.
  • Base64URL: URL-safe variant that replaces + with - and / with _, and drops padding. Required for JWT payloads, PKCE code verifiers, and any key that appears in a URL or cookie without percent-encoding.
  • Base58: excludes visually ambiguous characters (0, O, I, l). Standard in wallet addresses and token identifiers where humans may need to read or type the value.

When Not to Use a Generated Key Directly

  • If your framework derives a key from a passphrase (bcrypt, Argon2, PBKDF2), pass the passphrase to the derivation function rather than a pre-generated key. The KDF provides the work factor that defends against brute force; bypassing it and using a raw key removes that protection.
  • Keys generated here are not SSH key pairs, TLS certificates, or RSA/ECDSA private keys. Those are asymmetric key pairs and require a different tool and format (PEM or DER).
  • Never commit a secret key to a source-control repository. Store it in an environment variable, a secrets manager, or an encrypted vault. Rotate any key immediately if it is ever exposed.

Key strength

256-bit is the standard for AES-256, JWT secrets, and session tokens. 512-bit suits HMAC-SHA-512.

Encoding

/ 20
Generated Key
256 bits of entropy — 32 bytes from crypto.getRandomValues
de79d8a42f3fe55f0c4900ff7c032289120dfebc5664b8eaccf9a2b7a49c71f2

Keys are generated entirely in your browser using crypto.getRandomValues — a CSPRNG. Nothing is sent to a server. Never share or commit secret keys; rotate them if they are ever exposed.