Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 strings. Unicode supported.

About Base64 encoding

Base64 is a way to represent arbitrary binary data using only printable ASCII characters. Every three bytes of input produce four characters of output, drawn from a 64-letter alphabet (A-Z, a-z, 0-9, plus + and /). The encoding is a transport wrapper, not a compression scheme — the result is roughly 33% larger than the input — and it is not a form of encryption.

Base64 is encoding, not encryption

Anyone who can read a Base64 string can decode it back to the original bytes in a single line of code. Never use Base64 to "hide" passwords, tokens, API keys or any other sensitive value — it provides zero confidentiality. For real protection, encrypt the data first, then optionally Base64 the ciphertext for transport.

Despite those caveats, Base64 is everywhere. It appears in data: URLs that embed images directly into HTML (see our Image ↔ Base64 tool), in HTTP Basic Auth headers, in PEM-encoded TLS certificates, in JWT headers and payloads, in email attachments via MIME, and in any system that needs to fit binary data into a text-only field. This tool encodes and decodes both UTF-8 strings and raw bytes safely in the browser.

How to use

  1. Choose Encode or Decode mode using the toggle.
  2. Paste your text or Base64 string into the input area.
  3. The output updates as you type. Errors during decoding (invalid characters, bad padding) are flagged inline.
  4. Use Copy to copy the result, or Swap to round-trip the value back through the other direction.

Common use cases

  • Embedding small images into CSS or HTML to save an HTTP request.
  • Decoding JWT headers and payloads to inspect their claims.
  • Reading the contents of a PEM-encoded TLS certificate.
  • Inspecting Authorization: Basic headers during API debugging.

Frequently asked questions

Is Base64 encryption?

No. Base64 is a reversible encoding, not an encryption. Never use it as a security measure for passwords, tokens, or anything else that needs to remain confidential.

Why do some Base64 strings end with one or two equals signs?

The equals signs are padding. Every group of four output characters represents three input bytes; if your input length is not a multiple of three, the last group is padded with = to keep the alignment.

What is URL-safe Base64?

A variant that replaces "+" with "-" and "/" with "_" so the encoded string can appear in URLs without further escaping. JWT uses URL-safe Base64 with the padding stripped.

Does decoding handle non-UTF8 binary data?

Yes. The tool decodes to raw bytes first and then attempts to render the result as UTF-8. If the bytes are not valid text, you can still copy the underlying buffer.

Advertisement