Base64 Encoder / Decoder

Convert text or files to Base64 and back, without mangling non-ASCII characters.

no file selected
ready
—

How to use the base64 encoder / decoder

  1. Choose Encode or Decode.
  2. Paste text, or drop a file for encoding.
  3. Use the URL-safe option when the output goes into a query string.
  4. Copy the result, or download the decoded bytes as a file.

Base64 turns arbitrary bytes into the 64 characters A–Z, a–z, 0–9, + and /. It is not encryption and adds about 33% overhead — its job is to move binary data through channels that only accept text, such as JSON fields, HTTP headers, XML and data URLs.

Two details trip people up constantly. First, Base64 encodes bytes, not characters: Chinese, Arabic or emoji only round-trip correctly if the encoder uses UTF-8, which this tool does in both directions. Second, the characters + and / are meaningful in URLs, so the URL-safe variant replaces them with - and _; passing a standard Base64 string through a query parameter without decoding the + as a space is a classic bug.

Where you meet Base64 day to day

Because Base64 is trivially reversible, never treat it as protection for secrets — and remember that a decoded file from an untrusted source should be scanned before you open it.

Frequently asked questions

Is Base64 encryption?

No. It is an encoding with no key, reversible by anyone. Use a proper cipher for confidentiality.

Why does decoding fail with an error?

The string is probably truncated (missing padding =), contains whitespace or URL-safe characters, or is not Base64 at all. Enable URL-safe mode or clean the whitespace first.

Can I encode a PDF or image?

Yes — drop the file in and you get a data-URL-ready string, or a .txt file to save.

Does it work with Chinese text?

Yes, encoded as UTF-8 in both directions, so the round trip is lossless.

Related tools