Random for Developers

Raw Random Bytes Generator

Generate raw cryptographically secure random bytes for keys, salts, and tokens — shown in hex or Base64, with each byte visualized as a color in a mosaic.

Cryptographically secure Instant, in your browser Free, no sign-up

Generate

Your result will appear here

How the Raw Random Bytes Generator works

Unlike Xrandom's other string and password tools, which build output from a limited character alphabet, this tool exposes truly raw random bytes — the full 0–255 value range per byte — encoded either as hexadecimal (two characters per byte) or Base64 (compact, roughly 4 characters per 3 bytes). This is the format most cryptographic libraries expect when you need a raw key, salt, initialization vector, or bearer token.

The color mosaic is a purely visual way to 'see' the randomness: each byte's value (0–255) maps to a position on the color wheel, so the mosaic becomes a unique, non-repeating pattern for every generation — a quick visual sanity check that two generated values are actually different, at a glance.

How to use it

1
Set the byte lengthChoose how many raw random bytes you need — 16 or 32 bytes is typical for keys and tokens.
2
Choose a formatHexadecimal is the most common representation for keys and hashes; Base64 is more compact and common in tokens and config files.
3
GenerateXrandom draws the bytes from your browser's cryptographically secure random source and displays both the encoded string and a color mosaic — one colored square per byte.
Advertisement

Frequently asked questions

How many bytes should I use for a secure key?

16 bytes (128 bits) is the minimum generally considered secure for symmetric keys; 32 bytes (256 bits) is a common modern standard for higher-security applications.

What's the difference between hex and Base64 here?

Both encode the same underlying random bytes; hex uses two characters per byte and only 0-9/a-f, while Base64 packs bytes more compactly using a 64-character alphabet, resulting in a shorter string for the same number of bytes.

Does the color mosaic affect the randomness?

No, it's purely a visualization of the same bytes shown in the text output below — colors are derived directly from each byte's value, with no separate randomness involved.

Is this safe to use for real cryptographic keys?

The bytes come from the Web Crypto API's cryptographically secure random source, the same standard used for real cryptographic key generation in browsers — but always generate and handle real production secrets according to your system's security requirements.