freesabai

Developer tools

Base64 encode and decode

Turn text into Base64 and back. Thai and emoji come out right because it uses UTF-8. Choose the URL-safe form, turn a file or picture into Base64 (or a data URI), and decode Base64 that holds a picture or a PDF back into a file. It runs in your browser, and your data and files are not sent anywhere.

This tool needs JavaScript. If you still see this after a few seconds, JavaScript is switched off in your browser or the page did not load completely: turn JavaScript on or reload the page.

How to use it

  1. Choose "Encode", then type or paste text (or press "Open file"). The Base64 appears at once. Choose URL-safe, or drop the = padding.
  2. Or choose "Decode" and paste Base64 to get the text. If it is a file (a picture, a PDF) you get a "Download as a file" button and a preview of a picture.
  3. Press "Copy" or "Download".

Frequently asked questions

Why is Thai garbled after I decode Base64?

Because the text was encoded with a character set other than UTF-8 (such as TIS-620 or Windows-874). This tool decodes as UTF-8, the web standard. If the data is not UTF-8 it warns you that it is not text and offers a file download instead.

How is URL-safe Base64 different from the usual one?

The usual one uses + and /, which have special meanings in URLs. URL-safe uses - and _ instead and often leaves off the = at the end (as in JWT). The decoder reads both, so you need not choose.

Can I turn a picture into Base64 for HTML or CSS?

Yes. Press "Open file", choose the picture and tick "Add a data: prefix". You get data:image/png;base64,…, which goes in a src or a url(). It suits small pictures only, because Base64 is about a third bigger than the file.

Good to know

Your data stays on your device

Everything runs in your browser. What you type, paste or open is not sent to freesabai's servers or anyone else's, and is not kept in the browser: close the page and it is gone. The site only counts how many times this page was opened and how many times someone copied or saved a result (never what was pasted or the result, and you can switch the counting off in the footer; see the privacy policy).

Report a problem or suggest an idea

Found a bug, or want this tool to do more? Tell us on the feedback page. No sign-up.

Other developer tools

JSON and data

Encoding, hashes and tokens

Generators

Time, numbers and colour

Text and code