Random Bytes Generator
Generate cryptographically secure random bytes in hex or Base64.
About Random Bytes Generator
Random Bytes Generator produces cryptographically secure random bytes using the browser's built-in CSPRNG via the Web Crypto API (window.crypto.getRandomValues), ensuring each output is suitable for security-sensitive applications. Output is available in hexadecimal or Base64 encoding at any length from 1 byte to several kilobytes. Cryptographically secure random bytes are the foundation of secure encryption keys, initialization vectors, nonces, session tokens, and password salts. Because the generation happens entirely client-side, the random values are never transmitted to any server.
How to Use
Specify the number of bytes you need in the length field, for example 16 bytes for an AES-128 key, 32 bytes for an AES-256 key, or 12 bytes for a GCM nonce. Choose the output format, either lowercase hexadecimal or Base64. Click Generate to produce a fresh set of cryptographically secure random bytes. Each click calls window.crypto.getRandomValues for a new independent output. Copy the result directly for use in configuration files, key management systems, or application code.
Common Use Cases
- Generating 128-bit (16-byte), 192-bit (24-byte), or 256-bit (32-byte) AES symmetric encryption keys for application security
- Creating 96-bit (12-byte) initialization vectors for AES-GCM authenticated encryption to ensure ciphertext uniqueness
- Producing 256-bit (32-byte) secure random tokens for API authentication, password reset links, and session identifiers
- Generating random nonces for cryptographic challenge-response protocols and CSRF token generation
- Creating high-entropy random salt values for password hashing with bcrypt, Argon2, or PBKDF2 algorithms