consolelog.tools

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 cases

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

  1. 1Set "Byte length" to the number of random bytes you need (1 to 1,024).
  2. 2Choose a "Primary format" (Hexadecimal, Base64, Base64 URL-safe, Binary or Decimal) for the big display.
  3. 3Read the statistics strip: entropy in bits, byte count, unique values out of 256, and average byte value.
  4. 4Click the regenerate icon for a new random set whenever you want.
  5. 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