Random Byte Generator

Generate secure random bytes in hex, decimal, binary or Base64.

0 items

Random Byte Generator

Generate cryptographically secure random bytes in the format you need: hexadecimal, decimal, binary, octal or a single Base64 string. Random bytes are the raw material of salts, nonces, initialisation vectors, tokens and test payloads, and this tool gives you any amount up to 64 KiB with one click.

Output formats

  • Hexadecimal – two digits per byte, optionally uppercase and with 0x.
  • Decimal – values from 0 to 255, ready for Uint8Array or Python bytes([...]).
  • Binary – eight bits per byte with optional 0b.
  • Octal – three digits per byte, the notation used in C escape sequences.
  • Base64 – all bytes encoded into one compact string for configs and HTTP headers.

The separator menu controls how bytes are joined: spaces by default, or commas for array literals, new lines for one byte per line, or nothing at all for a continuous hex string.

Typical uses

Developers generate 16 random bytes for an AES IV or a UUID-style identifier, 32 bytes for an HMAC key or a session secret, and longer sequences for fuzzing parsers, binary file formats and network protocols. Security learners use the output to see how salts change password hashes.

Secure by design

Bytes are produced with the Web Crypto API (crypto.getRandomValues) in your browser. Nothing is sent to a server and nothing is stored. Close the tab and the values are gone.

Need longer hexadecimal tokens instead of separate bytes? Use the Random Hex Generator. To turn your bytes back into text or files, see the Base64 Encode/Decode tool.

Frequently Asked Questions

The bytes come from crypto.getRandomValues, the browser's cryptographically secure generator, and are created only on your device. For production secrets it is still best to generate keys inside the system that will use them, so they are never copied around.

Choose Hexadecimal, turn on the prefix and select 'Comma + space' as separator. You get 0x3f, 0xa2, … which you can paste between braces or brackets.

Base64 encodes a whole byte sequence, not single bytes, so the selected number of bytes is encoded together. 16 bytes become a 24-character string ending in ==.

Up to 65,536 bytes (64 KiB) per click, which is the limit of a single crypto.getRandomValues call in browsers.