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
- Pick byte count (1-256) — 16 for an IV, 32 for an HMAC key, 64 for an OAuth client secret.
- Choose the output format. Use Base64URL for cookies and JWTs (no padding, URL-safe).
- 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
Random Number Generator
Generate cryptographically random numbers in any range — with or without duplicates, optionally sorted.
Group Maker
Split a list of names into balanced random groups — pick the group count or the people per group.
Raffle Draw
Pick N winners from a list of names — cryptographically random, with or without duplicates.
Dice & Coin Roller
Roll polyhedral dice (d4–d100) or flip a coin with cryptographic randomness.
Random Picker — Roulette & Ladder
Pick a winner with a spinning wheel or a ladder (ghost-leg) draw.
Password Generator
Generate strong, random passwords that never leave your browser.