Developer

Random Bytes Generator

Generate cryptographically secure random bytes and view them as hexadecimal, Base64, a byte array or binary. Ideal for keys, salts and nonces.

Last reviewed by the Radiatus Cloud team

Generate secure random bytes as hex, Base64, a byte array or binary.

Need this built for your product?

We design, build & host secure software & APIs.

Talk to an engineer

Generate secure random bytes

Random bytes are the raw material of cryptography, used for encryption keys, salts, initialisation vectors, nonces and session tokens. This generator produces the number of bytes you request and displays them in your preferred format: hexadecimal, Base64, a comma-separated byte array ready to paste into code, or binary. It uses the browser's cryptographically secure random number generator where available, so the output is suitable for genuine security use rather than merely looking random.

Hexadecimal is the most common way to represent keys and salts, Base64 is compact and text-safe, and the byte array form drops straight into source code.

Where random bytes are needed

Developers generate random bytes when creating cryptographic keys, salting passwords before hashing, producing unique tokens, and seeding tests that need unpredictable data. Using a secure source is critical: predictable randomness has broken real systems, so the quality of the generator matters as much as the length.

Choose a length appropriate to the purpose, for example sixteen bytes for an AES key or a salt, and thirty-two for stronger keys. The bytes are generated entirely in your browser and never transmitted, so secrets stay private. For production secrets, prefer generating them in your secure environment.

Related tools

  • JSON Formatter — Format and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
  • JSON Validator — Validate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
  • Regex Tester — Test regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.
  • HTML Minifier — Minify HTML by removing comments and redundant whitespace, without breaking inline elements or pre blocks. Runs entirely in your browser.

Frequently Asked Questions

Are the bytes cryptographically secure?

Where your browser provides a secure random generator, yes. The tool uses it, falling back to a standard generator only if it is unavailable.

How many bytes should I generate?

Sixteen bytes suit an AES key, a salt or an initialisation vector, while thirty-two bytes give stronger keys. Match the length to the purpose.

What is the difference between the formats?

Hexadecimal is the usual representation for keys and salts, Base64 is compact and text-safe, the byte array pastes into code, and binary shows the raw bits.

Are the bytes sent to a server?

No. They are generated locally in your browser and never transmitted, so the values remain private to you.

Can I use these for production secrets?

They are high quality when a secure generator is available, but for critical production secrets it is best practice to generate them inside your own secure environment.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Choose how many bytes and the output format, then generate.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.