Advertisement
Advertisement

Base64 Encoder & Decoder

Convert text and files to Base64 and back, including emoji and accented letters.

🔒 Text and files are converted by your own browser. Nothing is uploaded.

How to use the Base64 Encoder & Decoder

  1. Choose a tab: Text for words and code, File → Base64 to encode any file, or Base64 → File to turn Base64 back into a file.
  2. For text, pick Encode or Decode and type or paste. The result updates as you type.
  3. Tick URL-safe when the Base64 will go in a web address or file name; it uses - and _ instead of + and /.
  4. For files, tick Include data URL prefix if you want to paste the result straight into HTML or CSS.
  5. Click Copy or download the result. When decoding produces binary data, use Download decoded bytes.

How it works

Base64 (RFC 4648) writes binary data using only 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes become 4 characters, so the output is about 33% larger than the input. When the input length isn't a multiple of 3, one or two = signs pad the end. The URL-safe variant swaps + and / for - and _ and often drops the padding.

Text is first turned into bytes with UTF-8, the encoding the web uses, so emoji and accented letters survive the round trip. For example, héllo 👋 is 11 bytes in UTF-8 and encodes to aMOpbGxvIPCfkYs=. Decoding reverses the steps and checks that the bytes are valid UTF-8; if they aren't, the data is probably a binary file, and you can download it instead of viewing it.

The decoder is forgiving about formatting: it ignores spaces and line breaks, accepts both the standard and URL-safe alphabets, and works with or without padding. It still points out real problems, such as a character that doesn't belong in Base64 or a length that can't be right. For images specifically, our Image to Base64 tool shows a preview and ready-made HTML and CSS snippets.

Frequently asked questions

Is Base64 encryption?
No. Base64 is an encoding, not a lock. Anyone can decode it in a second, so never use it to hide passwords or private data. To protect a file, use our File Encryption Tool.

Why does my decoded text look like random symbols?
The Base64 probably holds a binary file (an image, PDF or zip) rather than text. Use Download decoded bytes or the Base64 → File tab to save it, and the tool will try to guess the right file type.

What is a data URL?
A data URL puts a file directly inside a link, like data:image/png;base64,iVBOR…. Browsers can display it without a separate download, which is handy for small icons in HTML or CSS.

When should I use URL-safe Base64?
Use it whenever the encoded text goes into a URL, a cookie or a file name, because +, / and = have special meanings there. JSON Web Tokens, for example, use URL-safe Base64 without padding.

Is there a size limit?
Only your device's memory. Files of tens of megabytes encode fine on a computer. Very large results are offered as a download rather than shown in the box, to keep the page responsive.

Advertisement

You might also need