Base64 encoder and decoder

Convert UTF-8 text and files to and from Base64.

Runs in your browser

Operation

Output

wqFIb2xhLCBtdW5kbyEg8J+Riw==

28 characters

What it does: Base64 encoder and decoder

Base64 represents binary data using only 64 text characters so it can be embedded in JSON, emails, URLs or CSS. This tool encodes and decodes text as proper UTF-8, so accents and emoji don't get mangled.

It can also convert files up to 5 MB to Base64 and supports the URL-safe variant (base64url).

How to use it

  1. Choose whether to encode text, decode Base64 or convert a file.
  2. Type, paste or select the input.
  3. Copy the result.

Examples

Text with accents

“Año” encodes to QcOxbw== (UTF-8). Many older tools break on non-ASCII characters.

Image in CSS

Convert a small icon to Base64 and use it as a data URL in your stylesheet.

Limits, formulas and assumptions

  • Base64 is not encryption: anyone can decode it. Never use it to protect passwords.
  • The output is roughly 33 % larger than the original data.
  • When decoding, spaces and line breaks are ignored and a data:…;base64, prefix is accepted.

Frequently asked questions

What is the URL-safe variant?

It replaces + and / with - and _ and drops the = padding so the result can go in a URL or file name without escaping. JWTs use it, for example.

Why do I get a UTF-8 error when decoding?

Because the data is binary (an image, a PDF…) rather than text. You can download it as a file.

Is my data sent anywhere?

No. Encoding uses your browser's TextEncoder, TextDecoder and btoa APIs.

Related guides