Random Bytes Generator
Get raw random bytes from the browser’s secure generator, formatted the way your code expects.
Processed locally in your browser/ Your data stays in your browser.
What is Random Bytes Generator?
Random bytes are the raw material for keys, nonces, salts, IVs and secrets. They should come from a cryptographically secure generator, never from a general-purpose PRNG. This tool calls crypto.getRandomValues, the same source browsers use for TLS and Web Crypto.
Choose the number of bytes (1 to 1024) and the output format: hex (optionally uppercase), Base64, Base64url without padding or decimal values from 0 to 255. Common sizes: 16 bytes for a 128-bit key or UUID-sized ID, 32 bytes for a 256-bit key, 12 bytes for an AES-GCM nonce, 16 bytes for a PBKDF2 salt.
How does it work?
- Set the number of bytes you need (for example 32 for a 256-bit key).
- Pick hex, Base64, Base64url or decimal output.
- Press Generate and copy. Every click produces new, independent bytes.
Common use cases
- Creating a 256-bit secret for HMAC signing or JWT HS256 in a development environment.
- Generating a salt or IV to test an encryption routine.
- Getting test vectors of a given length for unit tests.
- Producing an opaque session or CSRF token in Base64url.
Examples
Get raw random bytes from the browser’s secure generator, formatted the way your code expects.
Privacy
Random Bytes Generator runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
Bytes shown on a web page have been visible to your screen and clipboard, so do not use production master secrets generated here. For high-stakes keys, generate them on the machine or HSM that will use them.
Frequently asked questions
How many bytes make a 256-bit key?
32 bytes. In hex that is 64 characters, in Base64 it is 44 characters (with padding).
Is this the same randomness browsers use for TLS?
It is the same Web Crypto API (crypto.getRandomValues), backed by the operating system’s secure random generator.
Why Base64url?
It replaces + and / with - and _ and drops padding, so the value can sit in URLs, cookies and JWTs without escaping.
Related tools
Random String Generator
Produce random tokens, IDs and test strings from the character set you need.
Developer Tools
Password Generator
Create strong, truly random passwords with the character sets you choose. Nothing is sent or saved.
Developer Tools
UUID Generator
Create one or thousands of universally unique identifiers in any version, formatted exactly the way your code or database expects.
Developer Tools
AES Encrypt (AES-256-GCM)
Turn text into an authenticated AES-256-GCM ciphertext protected by your passphrase, entirely on your device.
Developer Tools
PBKDF2 Key Derivation Generator
Compute a PBKDF2 derived key from a password, salt, iteration count and hash, and check it against test vectors.
Developer Tools
Base64 Encoder
Convert any text, including emoji and accented characters, into a Base64 string in one click.
Encoding & Decoding
Text to Hex Converter
See the exact bytes behind any text, from a quick "Hello" to emoji, formatted the way your code or debugger expects.
Encoding & Decoding
Random Hex Generator
Create random hex values of any length, formatted as a key, a nonce, a colour-style code or a byte array.
Developer Tools