Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 -- free, private, runs in your browser

Text
Base64

What Is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 printable ASCII characters: the uppercase letters A-Z, lowercase a-z, digits 0-9, and two symbols (+ and /). A padding character (=) is used to ensure the output length is a multiple of four.

The encoding exists because many systems -- email, URLs, JSON, XML -- are designed to handle text, not raw binary. When you need to embed an image in a stylesheet, attach a file to an email, or pass binary data through a text-only API, Base64 gives you a safe text representation that survives transmission without corruption. Every three bytes of input become four Base64 characters, making the encoded output about 33% larger than the original.

How to Encode and Decode Base64

  1. To encode, type or paste your text into the Text field on the left side of the tool
  2. Click the Encode button -- the Base64-encoded output appears in the right field
  3. To decode, paste a Base64 string into the Base64 field on the right side
  4. Click the Decode button -- the original text appears in the left field
  5. Use the Copy button below either field to copy the result to your clipboard

The tool automatically handles UTF-8 characters like accented letters, CJK characters, and emoji. If you paste something that looks like valid Base64, the tool will suggest decoding it automatically.

Common Uses for Base64

Base64 and URL Safety

Standard Base64 uses + and / as two of its 64 characters. These characters have special meaning in URLs: + can be interpreted as a space, and / is a path separator. This causes problems when Base64 strings appear in query parameters or URL paths.

The Base64url variant (defined in RFC 4648) solves this by replacing + with - and / with _. Padding (=) is often omitted since the decoder can infer it from the string length. Base64url is used in JSON Web Tokens (JWTs), data URIs in URLs, and many modern APIs.

Frequently Asked Questions

Does Base64 encrypt data?

No. Base64 is an encoding, not encryption. It transforms data into a different representation, but anyone can decode it instantly -- there is no secret key involved. Never rely on Base64 to hide or protect sensitive information.

Why does Base64 make strings longer?

Base64 maps every 3 bytes of input to 4 output characters. This 4:3 ratio means the encoded result is always approximately 33% larger than the original. The overhead is the trade-off for making binary data safe to transmit through text-only channels.

Is Base64 safe for passwords?

Absolutely not. Base64 is trivially reversible -- any developer can decode a Base64 string in seconds. For password storage, use dedicated password hashing algorithms like bcrypt, scrypt, or Argon2 that are designed to be slow and resistant to brute-force attacks.