Convert

Base64 Encoder and Decoder

Encode and decode Base64, including URL-safe variants and full Unicode.

Runs entirely in your browser — nothing you paste is uploaded or stored.

Base64
Encoded output appears here.

What is base64 encoder?

Base64 encodes arbitrary binary data using only 64 printable ASCII characters, so it can travel safely through systems that were designed for text — email bodies, JSON fields, HTTP headers, data URLs. It is an encoding, not encryption: anyone can decode Base64, and it provides no confidentiality whatsoever. This tool converts in both directions and handles the case most naive implementations get wrong, which is non-ASCII text such as accented characters, emoji and CJK scripts.

When to use it

  • Decoding the payload of an API response, webhook or configuration value that arrived Base64-encoded and needs to be read.
  • Building a data URL to embed a small image or font directly in CSS or HTML without a separate network request.
  • Encoding credentials for HTTP Basic authentication, which requires a Base64 representation of "username:password".
  • Inspecting a Base64 field inside a Kubernetes Secret, which stores all of its values in this encoding.

How to use this tool

  1. Choose Encode to convert plain text to Base64, or Decode to convert Base64 back to text.
  2. Paste your input on the left. The conversion runs as you type; there is no submit button.
  3. Tick "URL-safe" when encoding if the result will appear in a URL or filename — it swaps + and / for - and _ and drops the padding.
  4. Press "Use result as input" to feed the output back in and round-trip it, which is a quick way to confirm a value decodes to what you expect.

Example

Encoding text that contains a multi-byte character.

Input

Hello 🎉

Output

SGVsbG8g8J+OiQ==

The emoji occupies four bytes in UTF-8, which is why the output is longer than the character count suggests. Encoders that use the browser's btoa() directly throw an error on this input instead.

Base64 and binary data

This tool works with text. If you decode a Base64 string that represents a PNG or a ZIP archive, the bytes are perfectly valid but they are not readable text, and the tool will tell you so rather than displaying mojibake. Decoding binary payloads to a file is outside what a text tool can usefully do.

Frequently asked questions

Is Base64 a form of encryption?

No, and treating it as one is a genuine security mistake. Base64 is a reversible encoding with no key involved — anyone who sees the encoded string can decode it in seconds. It exists to make binary data safe to transport through text-only channels, not to hide anything. If you need confidentiality, you need actual encryption.

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

That is padding. Base64 works on three-byte groups, encoding each as four characters. When the input length is not a multiple of three, the encoder pads the final group and marks it with one or two "=" characters so the decoder knows how many bytes to discard. URL-safe Base64 usually omits padding, since "=" has meaning in query strings.

What makes a Base64 string "URL-safe"?

Standard Base64 uses "+" and "/" in its alphabet, and both have special meaning in URLs — "+" can be interpreted as a space and "/" as a path separator. URL-safe Base64, defined in RFC 4648, substitutes "-" and "_" respectively and typically drops the "=" padding. This tool decodes both variants automatically.

Why did my decode produce an error about UTF-8?

The input decoded successfully as Base64, but the resulting bytes are not valid UTF-8 text — which usually means the original data was binary, such as an image or a compressed file, rather than text. This tool displays text, so it reports the problem rather than showing you replacement characters and pretending it worked.

Does encoding make my data bigger?

Yes, by roughly 33%. Every three bytes of input become four characters of output. That overhead is the price of making binary data safe for text channels, and it is why you should not Base64-encode large files unnecessarily — an image embedded as a data URL is about a third larger than the same image served as a file.