Random Bytes Generator
Generate cryptographically-secure random bytes live (Web Crypto API) — hex, Base64, Base64-URL, binary or decimal, with byte statistics.
About this ToolHow it works, benefits & use casesTap to collapse
Produce cryptographically secure random bytes and view them in whatever encoding your task needs. Generation uses the Web Crypto API (crypto.getRandomValues), the browser's secure random source, so the output is suitable for keys, salts, tokens and nonces. Set the byte length anywhere from 1 to 1,024 and the tool renders the same bytes in five encodings at once — hexadecimal, Base64, URL-safe Base64, binary, and decimal — each with its own copy button, plus a large primary display for the format you select. A statistics strip shows the entropy in bits, the byte length, how many distinct byte values appeared out of 256, and the average byte value, so you can sanity-check the randomness at a glance. Hit regenerate for a fresh set, copy any encoding, or pipe the hex output into another tool. Your length and primary-format choices are remembered locally, and nothing is generated on or sent to a server.
How to Use
- 1Set "Byte length" to the number of random bytes you need (1 to 1,024).
- 2Choose a "Primary format" (Hexadecimal, Base64, Base64 URL-safe, Binary or Decimal) for the big display.
- 3Read the statistics strip: entropy in bits, byte count, unique values out of 256, and average byte value.
- 4Click the regenerate icon for a new random set whenever you want.
- 5Copy any of the five encodings with its copy button, or pipe the hex output into another tool.
Key Benefits
- Cryptographically secure bytes from the Web Crypto API (crypto.getRandomValues)
- Same bytes shown simultaneously in hex, Base64, URL-safe Base64, binary and decimal
- Adjustable length from 1 to 1,024 bytes
- Statistics strip with entropy, unique-value count and average for a quick randomness check
- One-click copy for every encoding, plus a selectable primary format
- Hex output can be piped into other tools on the site
- Generated entirely in your browser — never sent to a server
Common Use Cases
- Generating a secret key, API token or session secret as hex or Base64
- Producing a random salt for a password-hashing routine
- Creating a nonce or initialization vector for encryption
- Getting URL-safe Base64 random data for use in links or filenames
- Inspecting raw random bytes in binary or decimal while debugging
Generating…1 – 1024 bytes
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- Base64 Encoder/DecoderEncode and decode Base64 strings
- File Size FormatterConvert any file size across decimal (KB/MB/GB) and binary (KiB/MiB/GiB) units side by side, with exact byte counts and a download-time estimator across 56k → fiber connection speeds
- Random Color GeneratorGenerate random colors
- Random String GeneratorGenerate random strings with custom options
- Hash GeneratorGenerate MD5, SHA-1, SHA-256, SHA-512 hashes
- Password GeneratorGenerate secure random passwords
Yes. The bytes come from the Web Crypto API's crypto.getRandomValues, which is the browser's cryptographically secure pseudo-random number generator — not Math.random. That makes the output appropriate for keys, salts, tokens and other security-sensitive values.
Every generated set is shown in five encodings at once: hexadecimal, standard Base64, URL-safe Base64, binary, and decimal. You can copy any of them, and pick one as the large primary display via the "Primary format" selector.

