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
| Modes | Text encode/decode, file to Base64, Base64 to file |
|---|---|
| File limit | Up to 20 MB |
| Processing | In your browser; your files are not uploaded |
| Price | Free |
| Works on | Chrome, Edge, Safari and Firefox on Windows, Mac, Android and iPhone |
How to use Base64 Encode and Decode
- Choose Text, File to Base64 or Base64 to file.
- For text, pick Encode or Decode and paste your text. The result appears as you type.
- For a file, select it to get Base64 or a data URL you can paste into HTML or CSS.
- 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.