Hex Key Generator

Generate cryptographically secure random hex keys — 128, 192, 256, or 512-bit presets or any custom bit-length — with hex, base64, and raw bytes output plus one-click copy.

Key Length

256 bits — 32 bytes

Hexadecimal
Base64
Raw Bytes (decimal octets)
Copied!

Summary

Generate cryptographically secure random hex keys — 128, 192, 256, or 512-bit presets or any custom bit-length — with hex, base64, and raw bytes output plus one-click copy.

How it works

  1. Select a preset bit-length (128, 192, 256, or 512 bits) or enter a custom length.
  2. Click Generate — crypto.getRandomValues() fills a typed array with random bytes.
  3. Three output formats are shown: hex, base64, and space-separated raw bytes.
  4. Click the copy button next to any format to copy it to your clipboard.
  5. Click Generate again or change the bit-length to produce a fresh key at any time.

Use cases

  • Generate AES-128, AES-192, or AES-256 keys for symmetric encryption.
  • Create HMAC-SHA256 or HMAC-SHA512 signing keys for API authentication.
  • Produce random session secrets for web application configuration.
  • Generate initialization keys for custom encryption protocols.
  • Create key material for JWT secret generation or token signing.

Frequently Asked Questions

Last updated: 2026-07-01 · Reviewed by Nham Vu