YourTools.
简体中文
Back to the catalog
Tools

Base64 to image or file

Turn Base64 or a data: URI back into a file such as an image; the type comes from the content or the URI.

Process locally

Files stay in this browser session. Closing or clearing releases them.

Add text

Type or paste the text to process

Adjust settings

Nothing to set; defaults work

This tool has no settings.

Run

Processes in this browser; cancel at any time

Add text first

About this tool

Turn Base64 text or a data: URI back into an image or any other file. Use it to see and save a picture you found as Base64 in page source or a JSON API response, or to restore a PDF or ZIP file someone sent you as Base64 text.

The file type is worked out from the decoded content first, covering common formats such as JPG, PNG, WebP, GIF, PDF, ZIP, fonts, audio and video, and from the data: URI's type otherwise. Up to 14 MB of Base64 text is decoded in your browser, and nothing is uploaded.

How to use it

  1. Paste the Base64 text or a full data URI starting with data:, or select Use example to load a small image.
  2. There are no settings to adjust, so select Run.
  3. Check the result in the preview: images and PDFs are shown, and text shows its beginning.
  4. Download the file. It is named decoded with a matching extension, such as decoded.png.

Formats and limits

Input
Text
Size limit
14 MB
Privacy
Files stay in the current browser session. No file bytes are uploaded.
Price
Free, no sign-up

Common questions

Can I paste a CSS url(...) value as it is?

No, paste only the part that starts with data:, or the plain Base64. Quotes around it and a trailing semicolon or comma are removed for you, and line breaks, spaces and \n sequences from JSON strings are ignored, so a value copied from JSON works as it is.

Why did a Word document come back as a .zip file?

DOCX, XLSX and other Office files are ZIP archives inside, and the tool names the file after its content, so you get decoded.zip. Change the extension back to .docx or .xlsx after downloading.

Why do I get decoded.txt or decoded.bin?

When the content is not a recognized format and no data: prefix gives a type, UTF-8 text is saved as decoded.txt and anything else as decoded.bin. SVG images are text too: plain Base64 gives decoded.txt, while a data:image/svg+xml;base64, prefix gives decoded.svg.

Why is my Base64 reported as invalid?

Base64 may contain only A–Z, a–z, 0–9, + and / (or - and _), with optional = padding at the end. Other characters picked up while copying cause the error, and so does a data URI that is not in the ;base64, form.

How do I turn an image into Base64?

Use the “Image or file to Base64” tool. It turns an image or any other file into Base64 or a data: URI.