Base64 String Generator
Generates a random token from cryptographically secure bytes and encodes it as Base64 — useful as a placeholder value, test fixture, or random identifier. This is a random token, not an encoding of any real data you provide.
What this generator does
Produces a random base64-encoded string of the length you choose, for filling fields that expect encoded data and for testing encoding and decoding paths.
How to use this tool
- Choose a byte length.
- Press generate for a random Base64 token.
- Copy it, or generate again for a new one.
Worked examples
- Format
- c29tZSByYW5kb20gYnl0ZXM=
- Alphabet
- A–Z, a–z, 0–9, plus and slash, padded with =
Common use cases
- Placeholder tokens for testing
- Random fixture data for development
- Generating a short random identifier
How this generator works
Random bytes are drawn from the browser's cryptographic source and encoded directly in base 64 at the length you choose. Encoding real random bytes rather than picking base-64 characters at random is the distinction that matters: the two produce visibly similar strings, but only the first decodes to anything, and padding lands where the byte count says it should.
Limitations and good to know
- Standard base 64, not the URL-safe variant — it contains + and /, both of which need escaping in a URL or a filename.
- Base 64 is an encoding, not encryption. It is trivially reversible and hides nothing from anybody.
- Encoding costs a third in size: three bytes become four characters, so this is a poor way to carry large data.
Related generators
- UUID GeneratorAn RFC 4122 v4 UUID for development or testing use — cryptographically random, not sequential.
- Recovery Code GeneratorGenerate a grouped, ambiguity-free recovery code for account backup use.
- Text Encoder and DecoderEncodes text as Base64, percent-encoding, HTML entities, hex or binary, and back again — accents and emoji included.