Base64 Encode and Decode

Encode and decode Base64 for text, images and any file, including data URLs.

Runs in your browser. Your files never leave your device.

How do I encode or decode Base64 text or files?

Open FixDoks's Base64 tool, choose Text, File to Base64 or Base64 to file, then paste or select what you need to convert. Text mode is UTF-8 safe for Hindi and emoji, files up to 20 MB become a data URL or plain Base64, and decoding rebuilds the original file. Everything runs in your browser.

Base64 Encode / Decode at a glance

ModesText encode/decode, file to Base64, Base64 to file
File limitUp to 20 MB
ProcessingIn your browser; your files are not uploaded
PriceFree
Works onChrome, Edge, Safari and Firefox on Windows, Mac, Android and iPhone

How to use Base64 Encode and Decode

  1. Choose Text, File to Base64 or Base64 to file.
  2. For text, pick Encode or Decode and paste your text. The result appears as you type.
  3. For a file, select it to get Base64 or a data URL you can paste into HTML or CSS.
  4. To turn Base64 back into a file, paste it, give the file a name and click Decode and download.

What is Base64?

Base64 is a way of writing any data, including images and other binary files, using only 64 safe characters: A to Z, a to z, 0 to 9, plus (+) and slash (/), with equals signs (=) as padding at the end. It lets binary data travel through systems built for text, such as email, JSON, HTML and URLs. It is an encoding, not encryption: anyone can decode it, so never use Base64 to hide passwords or secrets.

Base64 makes data about 33 percent bigger, because every 3 bytes become 4 characters. A 30 KB image turns into roughly 40 KB of Base64 text.

Text mode

Encoding first converts your text to UTF-8, so Hindi, emoji and accented letters work correctly. Many simple tools break on these because the browser's built-in btoa function only accepts Latin characters. Decoding does the reverse and warns you if the decoded bytes are not readable text, for example if you pasted an encoded image. In that case switch to Base64 to file.

URL-safe Base64 replaces + with - and / with _, and drops the = padding. It is used in JWT tokens, URL parameters and file names. The decoder accepts both forms automatically, and ignores spaces and line breaks, so Base64 copied from an email with wrapped lines still decodes.

File to Base64 and data URLs

Select any file up to 20 MB. With Include data URL prefix ticked, you get a string like data:image/png;base64,iVBORw0... that you can use directly:

  • In HTML: <img src="data:image/png;base64,...">
  • In CSS: background-image: url("data:image/svg+xml;base64,...")
  • In JSON or an API request body that expects an image as a string.

Embedding is best for small icons and images of a few KB. Larger images are better as normal files, because data URLs cannot be cached separately by the browser and make your HTML or CSS heavier.

Base64 to file

Paste Base64 text or a full data URL and the tool rebuilds the original file. It recognises PNG, JPG, GIF, WebP, PDF and ZIP from the first bytes and adds the right extension, and it shows a preview for images. This is useful for saving an image or PDF that an API returned as Base64, or for checking what a mysterious Base64 string in a log actually contains.

Privacy

Everything is done in your browser. Files you encode and Base64 you decode are never uploaded, which matters because Base64 strings in logs and emails often contain documents or tokens.

Frequently asked questions

Is Base64 encryption?
No. Base64 is an encoding that anyone can reverse instantly. Use it to move data safely through text systems, not to protect secrets.
How do I convert an image to Base64?
Choose File to Base64 and select the image. Copy the data URL and use it in an img tag or CSS.
How do I convert Base64 back to a PDF or image?
Choose Base64 to file, paste the text, and click Decode and download. The file type is detected automatically.
Why is the Base64 bigger than my file?
Base64 turns every 3 bytes into 4 characters, so the output is about a third larger than the original.
Does it support Hindi and emoji?
Yes. Text is encoded as UTF-8, so any language and emoji encode and decode correctly.