Skip to content
Filebird

Base64 encode & decode

Convert text and files to and from Base64

Files never leave your device

Base64 is a way of writing binary data using only 64 plain characters, so that it can travel safely through systems built for text. You meet it inside email attachments, data URLs in web pages, API tokens, basic authentication headers and config files. This tool converts in both directions. Paste text to get its Base64 form, paste Base64 to read the original, or work with whole files, for example turning a small image into a string you can embed in HTML or recovering a file someone sent you as Base64 text.

How to encode or decode Base64

  1. Pick the direction: encode to turn plain text or a file into Base64, decode to turn Base64 back into readable text or a file.
  2. Enter your input. Type or paste text, or choose a file from your device.
  3. If you need the variant used in URLs and tokens, switch on the URL-safe option before converting.
  4. Read the output. For decoding, if the result looks like random symbols, the original was probably binary, such as an image, rather than text.
  5. Copy the output, or download the decoded data as a file when it is not text.

Options explained

  • Encode: Converts input into a string of letters, digits, plus and slash characters, padded with equals signs at the end where needed. The output is roughly a third larger than the original, because every three bytes become four characters.
  • Decode: Reverses the process. Line breaks and spaces inside the Base64 are tolerated, which helps with text that was wrapped in an email or a certificate.
  • UTF-8 safe text: Text is first turned into UTF-8 bytes, then encoded. That means Arabic, accented letters, symbols and emoji round-trip correctly. Simple encoders that ignore this break on any character outside basic English.
  • URL-safe variant: Replaces the plus and slash characters with a hyphen and an underscore and usually drops the equals padding, so the result can sit inside a URL or filename without extra escaping. This is the form found in JSON Web Tokens.
  • Files: A file is read as raw bytes and encoded; decoding Base64 of a file lets you save the original bytes back to a file.

Tips and common problems

Base64 is not encryption: Anyone can decode it instantly. Do not use it to hide passwords or personal information, only to carry data through text-only channels. If you need a fingerprint rather than reversible encoding, see the Hash generator.

"Invalid character" errors usually mean the wrong variant: A string with hyphens and underscores is URL-safe Base64, while one with plus and slash is standard. Switch the option to match, or replace those characters.

Missing padding: Some systems strip the trailing equals signs. A correct decoder can usually cope, but if decoding fails, try adding one or two equals signs to make the length a multiple of four.

Data URLs: If you see something starting with data:image/png;base64, only the part after the comma is the Base64 data. Paste just that part for decoding, and expect a binary file rather than readable text.

Garbled result after decoding: If the original text was encoded using a different character set rather than UTF-8, the decoded text may show wrong characters. The data is intact; only the interpretation is off.

Large files inflate: Embedding a big image as Base64 in HTML or CSS makes the page larger than linking the file would. It is best kept for tiny icons. To shrink an image first, try Compress image.

Your files stay on your device

Text and files are converted by your browser, with no upload and no server involved, so tokens, keys and private documents you paste stay on your machine. The conversion needs nothing extra to be downloaded. See How it works for how the site handles local processing.

Frequently asked questions

Is Base64 secure?

No. It is an encoding, not encryption, and can be reversed by anyone without a key. Treat anything you encode as being as visible as the original.

Why does Base64 end with equals signs?

Data is encoded in blocks of three bytes. When the input does not fill the last block, one or two equals signs pad the output so the length stays a multiple of four.

Can it handle Arabic and emoji?

Yes. Text is converted through UTF-8, so characters outside plain English survive a round trip.

What is URL-safe Base64?

A variant that swaps plus and slash for hyphen and underscore, so the string is safe in links and filenames. It is common in tokens and some APIs.

Can I decode an image or PDF?

Yes. Paste the Base64 string and download the decoded data as a file. Make sure the file name has the correct extension so your system opens it properly.

Is there a maximum file size?

No fixed limit, but the whole file is held in memory while it converts, so very large files can be slow or fail on phones.