3itt+IzA8+SMmf4QDE0g+g==
Generate random base64 strings and keys

This generator creates a random base64 string from random bytes. Choose the length in bytes, tick URL safe for the alphabet with - and _ instead of + and /, and press generate. The bulk card below creates several strings at once. Every result can be copied to the clipboard with the copy button.

Your last generated data 1
  • 3itt+IzA8+SMmf4QDE0g+g==
Bulk base64 string generator
  • BzOWxzH1WI2eRKyx+ABP4Q==
  • 0jwZDJYuWUMDl6FjZzxsXw==
  • ohPCLrA6Fe3lhFlZVA472w==
  • U8hNwLg0b4aBjruk8JU9xg==
  • RDkNDWJJF3dNaqbsc8Emrg==
  • LFMs7bVMhOw9EKLWSX+04g==

What is a base64 string?

Base64 writes binary data (for example a key, a file or an image) with 64 printable ASCII characters: A–Z, a–z, 0–9 and two more. Every 3 bytes become 4 characters, so a base64 string is about a third longer than the data it carries; one or two = at the end pad the last block. Base64 is used wherever binary data has to travel through text: e-mail attachments, data URIs, JSON, and the user name and password of HTTP Basic authentication.

Random base64 keys

A random base64 string is a compact way to write a random key. 16 bytes (128 bits) give a 24-character string, 32 bytes (256 bits) a 44-character one – 43 characters in the URL-safe form, which leaves out the padding. Typical uses are session secrets, API tokens for test environments and HMAC keys during development. The bytes come from a cryptographically secure random source. For production secrets, create the key on the machine that uses it, for example with openssl rand -base64 32, so that it never travels over a network.

Decode, encode and related tools

To turn base64 back into text, use the base64 decoder; to convert your own text, the base64 encoder. For percent-encoding in URLs there is the URL encoder and decoder, and the JWT decoder shows the header and the payload of a JSON Web Token.

Base64, URL and JWT tools

Frequently asked questions

What is a Base64 string?
Base64 encoding converts an 8-bit binary data stream, for example a program, an archive or an image, into a character sequence made only of readable ASCII characters.
What is URL-safe Base64?
The URL-safe variant replaces the characters that have a special meaning in URLs, so the encoded string can be used in a link or a file name without further escaping.
Is Base64 a form of encryption?
No. Base64 is an encoding, not encryption. Anyone can decode it, so it protects nothing on its own.
Where is Base64 used?
Among other things for transporting binary data over text based protocols and for encoding user name and password in HTTP basic authentication.