AZ Tools

Random Bytes Generator

Random

Generate up to 256 bytes of cryptographically secure random data using the browser's `crypto.getRandomValues()` API — suitable for API keys, session tokens, IVs, salts, and test fixtures. Output formats cover most needs: lowercase/uppercase hex, standard or URL-safe Base64, binary string, decimal byte array, C uint8_t array literal, Python `b'...'` literal, and RFC 4122 v4 UUID (when 16+ bytes are generated). Separator options (none/space/comma/colon/dash) let you match MAC-address, certificate-fingerprint, or custom formats.

How to use

  1. Pick byte count (1-256) — 16 for an IV, 32 for an HMAC key, 64 for an OAuth client secret.
  2. Choose the output format. Use Base64URL for cookies and JWTs (no padding, URL-safe).
  3. Click 'Generate' for a fresh value; changing options re-renders the existing bytes.

Frequently asked questions

Is this cryptographically secure?
Yes. It uses `crypto.getRandomValues()`, the Web Crypto API's CSPRNG. All generation happens locally in your browser — bytes never leave your device.
Why 256 bytes max?
For most security uses (keys, tokens, salts) you need 16-64 bytes. Capping prevents accidentally locking the UI with multi-MB output. Use a CLI tool (`openssl rand`, `head /dev/urandom`) for large amounts.
What's the difference between Base64 and Base64URL?
Base64 uses `+`, `/`, and `=` padding — fine for JSON but unsafe for URLs and filenames. Base64URL replaces `+` → `-`, `/` → `_`, drops `=` padding — used in JWTs, OAuth state, and URLs.

Related tools