Random Base64 Generator
Create random base64-encoded strings by generating arbitrary bytes and encoding them. Control byte length and choose between standard base64 and URL-safe base64url variant (replacing +/, removing padding).
Also known as: base64url · b64 · base-64
seeded · synthetic data
Presets
Output
About this tool, tips & examples
What it does
The Random Base64 Generator creates base64-encoded random byte strings:
choose how many bytes to encode (1 to 1,024), standard base64 or the
URL-safe base64url variant (- and _ instead of + and /, no
padding), and generate up to 1,000 strings per run. Seeded, so fixtures
stay stable.
Common use cases
- Test fixtures — realistic base64 blobs for fields that carry encoded payloads, signatures, or binary attachments.
- Token-shaped placeholders — values that look like session blobs or API tokens for UI and log testing (presets for 16/24/32-byte sizes).
- Encoding examples — demonstrate base64 vs base64url differences in docs and tests.
- Parser testing — decode paths exercised with valid input of controlled length.
Settings
- Bytes to encode — 1 to 1,024 random bytes; the output string is ~4/3 that length.
- URL-safe (base64url) — swaps
+/for-_and drops=padding — the variant used in JWTs and URLs. - How many — 1 to 1,000 strings per run.
- Seed — identical seed + settings = identical strings.
Privacy note
Strings are generated locally in your browser and never uploaded. These are seeded, reproducible fixtures — not secrets. For real tokens, use the Secure Token Generator, which draws from crypto randomness and is never seeded.
FAQ
Why does my string end in =?
Standard base64 pads to a multiple of 4 characters. Byte counts
divisible by 3 need no padding; base64url drops padding entirely.
When do I need base64url?
Anywhere the string travels in a URL or JWT — + and / break URLs and
must otherwise be percent-encoded.
Is base64 encryption? No — it’s encoding, trivially reversible. Anything sensitive needs actual cryptography; base64 just makes bytes text-safe.