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
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
- Paste the Base64 text or a full data URI starting with data:, or select Use example to load a small image.
- There are no settings to adjust, so select Run.
- Check the result in the preview: images and PDFs are shown, and text shows its beginning.
- 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.
Related tools
Image or file to Base64
Encode images or any other file as Base64 or as a data: URI to paste into HTML, CSS or JSON.
Base16/32/58/64/85/91 encoding
Encode or decode Base16, Base32, Base58, Base62, Base64, Ascii85, Z85 and basE91, choosing the character set of the text, or hex for raw bytes.
Encode and decode text
Encode or decode Base64, Base64URL, URL, hexadecimal or HTML entities. Encoding is not encryption.
Character set encoding and mojibake repair
Show the bytes of text in UTF-8, GBK, GB18030, Big5, Shift_JIS and more as hex, turn hex back into text, or repair mojibake from text read in the wrong character set.
Unicode, HTML, URL and Punycode escapes
Convert text to and from \u escapes, HTML numeric entities, percent-encoding in any character set (such as GBK URLs), Quoted-Printable and Punycode domains.
File to hex
Show any file as hex: a hexdump with offsets and an ASCII preview, plain hex, or a C byte array.