Base64 encoder

Encode any text or string to Base64 instantly. Useful for data URIs, HTTP Basic auth headers, email and APIs. Free online Base64 encoder.

Turn text into Base64 in one step

Base64 is a way of writing any data, including binary data, using only 64 safe characters: A to Z, a to z, 0 to 9, plus + and /, with = used as padding. Systems that were designed for plain text, such as email, JSON, XML and HTTP headers, can carry Base64 without the data getting mangled.

Paste your text into this encoder and it returns the Base64 version. For example, Hello, Botsy! becomes SGVsbG8sIEJvdHN5IQ==. The encoding is fully reversible: anyone can turn it back with a Base64 decoder.

Base64 output is roughly a third larger than the input, because every 3 bytes of data become 4 characters. That's the price of making data safe to send through text-only channels.

How to use the base64 encoder

  1. Paste or type the text you want to encode into the content box.
  2. Submit to encode it.
  3. Copy the Base64 result.
  4. Paste it where you need it: a header, a config value, a data URI or an API request.

Common uses

  • Building an HTTP Basic Authentication header, which is Basic followed by the Base64 of username:password.
  • Embedding small pieces of data in JSON or XML that must stay plain text.
  • Preparing values for Kubernetes secrets or environment variables that expect Base64.
  • Encoding strings for testing APIs and webhooks.
  • Creating data URIs. For images, use the image to Base64 tool instead.

Tips and things to know

  • Base64 is not encryption. It hides nothing; anyone can decode it in a second. Never rely on it to protect passwords or private data.
  • Standard Base64 uses + and /, which have special meaning in URLs. If you put Base64 into a URL, URL-encode it as well, or use the URL-safe Base64 variant if your system supports it.
  • The = signs at the end are padding, added when the input length isn't a multiple of 3 bytes. Most decoders need them.
  • Text is encoded as UTF-8, so accented letters and emoji are supported.

Frequently asked questions

What is Base64 encoding used for?

It lets binary or special-character data travel safely through systems built for plain text, such as email attachments (MIME), JSON payloads, HTTP headers and data URIs.

Is Base64 secure?

No. Base64 is an encoding, not encryption. It's trivially reversible and provides no security on its own.

Why does my Base64 string end with = or ==?

Those are padding characters. Base64 works in groups of 3 bytes; when the last group is short, one or two = signs fill it out.

Why is the encoded text longer than the original?

Base64 turns every 3 bytes into 4 characters, so the output is about 33% larger than the input.

How do I decode Base64?

Use our Base64 decoder. Paste the encoded string and it returns the original text.

Related tools

Similar tools

Base64 decoder

Decode Base64 strings back to readable text instantly. Inspect auth headers, tokens, API payloads and email content. Free online Base64 decoder.

Popular free tools