Base64 Encoder & Decoder

Encode text or files to Base64 and decode Base64 back to text, with URL-safe and UTF-8 support.

About this tool

Base64 is a way of representing binary data using only 64 safe text characters: the letters A-Z and a-z, the digits 0-9, and the symbols + and /. It is used whenever binary content has to travel through a system that only handles text, for example embedding a small image directly in HTML or CSS as a data URI, sending attachments in email (MIME), storing credentials in HTTP Basic authentication headers, and carrying binary values inside JSON or XML.

This tool converts in both directions. In encode mode it turns your text into a Base64 string, handling UTF-8 properly so emoji, accented letters and non-Latin scripts survive the round trip. In decode mode it converts a Base64 string back to readable text. It accepts input with line breaks, missing padding characters and the URL-safe alphabet (which uses - and _ instead of + and /), and it can strip a leading data:...;base64, prefix for you.

You can also encode a whole file, such as a small icon or image, to get a ready-to-use data URI. Keep in mind that Base64 makes data about 33% larger, so it is best for small assets. Most importantly, Base64 is encoding, not encryption: anyone can decode it, so never use it to hide passwords or secrets.

All conversion happens locally in your browser. Your text and files are not uploaded to any server.

How to use

  1. Paste your text or Base64 string into the input box.
  2. Click Encode to convert text to Base64, or Decode to convert Base64 back to text.
  3. Tick URL-safe if you need the variant that is safe for URLs and filenames.
  4. To convert a file, use Encode a file and pick it from your device. You can copy the Base64 text or the full data URI.
  5. Use Swap to move the output back into the input and continue converting.

Frequently asked questions

It lets binary data be sent through text-only channels. Common uses are data URIs in HTML and CSS, email attachments, JSON Web Tokens and HTTP Basic authentication.

No. Base64 only changes how data is represented. Anyone can decode it instantly, so it provides no confidentiality.

The equals signs are padding that makes the length a multiple of four. Some systems, including the URL-safe variant, omit the padding.

It replaces + with - and / with _ so the result can be used in URLs and filenames without escaping. It is the format used inside JSON Web Tokens.

The decoded bytes may not be UTF-8 text, for example when the Base64 was created from an image or other binary file. Try decoding a file instead, or check that the string is complete.

Files are processed in memory in your browser, so very large files may be slow. Base64 is intended for small files; for large files use normal file transfer.

Related articles

Web hosting by Somee.com