UTILS.
Private by default
🎲

Random Bytes Generator

Generate cryptographically secure random bytes as hex, base64, a decimal array or binary.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
— output appears here —

About this tool

Generate cryptographically secure random bytes in your browser using crypto.getRandomValues, then view them as hex, base64, a decimal array or binary.

Length is in bytes, from 1 to 1024, starting at 16. Fractions are cut off, an empty or zero entry falls back to 16, negative values become 1 and larger ones are lowered to 1024. Hex gives two lowercase characters per byte, base64 is the browser's btoa output, the decimal array lists numbers from 0 to 255 in square brackets, and binary shows eight digits per byte separated by spaces.

A new value is produced when the page opens and on every Generate press. Changing the format dropdown shows the same bytes in the new format, so you can copy one value as hex and then as base64.

Frequently asked questions

How random are the bytes?
They come from crypto.getRandomValues, the browser's cryptographically secure random number generator, suitable for keys, salts and tokens.
What output formats are available?
Hexadecimal, base64, a comma-separated decimal array and space-separated 8-bit binary, chosen from the format dropdown.
Do my bytes change when I switch format?
No. Switching the format re-encodes the bytes already on screen. Press Generate for a fresh set.
Is the base64 output URL-safe?
No. It is plain btoa output with padding, and there is no URL-safe option.

More tools