Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text online. Free developer tool.
Free · No sign-upHow to use Base64 Encode / Decode
- 1. Stay on the Text tab and type or paste your text, or a Base64 string you want to decode, into the top box.
- 2. Click Encode to convert text to Base64, or Decode to turn Base64 back into readable text. Tick URL-safe to use - and _ instead of + and /.
- 3. Click Copy to copy the result. For files, open the File tab and drop a file (up to 8 MB) to get its data URL or raw Base64.
- 4. To rebuild a file, paste Base64 or a data: URL into Base64 → File, enter a file name with the right extension, and click Download file.
Frequently asked questions
Is the Base64 encoder and decoder free?
Yes, it’s free with no sign-up and no limits for text. File-to-Base64 conversion works for files up to 8 MB, since the whole file is held in your browser’s memory and a data URL is about a third larger than the original.
Is it safe to decode Base64 with sensitive data like tokens?
Encoding and decoding run entirely in your browser with built-in JavaScript functions, and nothing is sent to our server. Keep in mind Base64 is not encryption: anyone who has the string can decode it, so don’t use it to protect passwords or secrets.
How do I decode a Base64 string to text?
Paste the string into the text box and click Decode. The result appears below as UTF-8 text, so emoji and accented characters display correctly. URL-safe Base64 with - and _ and strings missing = padding are handled automatically. If you see “Invalid Base64,” check for extra characters.
How do I convert an image to Base64 for HTML or CSS?
Open the File tab and drop the image. You’ll get a complete data URL (starting with data:image/…) to paste into an img src or CSS url(), plus a Copy raw Base64 button for APIs and JSON. Data URLs work best for small icons and images.
How do I turn a Base64 string back into a PDF or image file?
In the File tab, paste the Base64 or data URL into Base64 → File, type a file name with the correct extension, such as invoice.pdf or photo.png, and click Download file. When you paste a data URL, the file type is read from it automatically.
What’s the difference between standard and URL-safe Base64?
Standard Base64 uses + and / and pads with =. URL-safe Base64, used in JWTs and web links, swaps in - and _ and usually drops the padding. Tick URL-safe before encoding when the result will go into a URL, file name or token. Decoding accepts both.