This page covers two jobs that people split across two tools: encode a local image to a data URL or raw Base64, and decode a data URL or Base64 string back to a file. Both stay in the browser. Encode reads the original file bytes. It does not re-encode through canvas, so the Base64 matches the file you chose. Decode accepts data:image/jpeg, data:image/png, or data:image/webp, or raw Base64 of those types. The payload is sniffed again. SVG data URLs are refused.
A data URL is the MIME type plus Base64 in one string. CSS background-image and some markdown hosts accept that form. Raw Base64 is the same payload without the prefix. Copy writes the data URL. If you needed a different container before you embed, convert with the Image Format Converter first, then encode the new file.
Empty selection, unsupported type, oversized file, and bad Base64 are errors. Decode text larger than about 12 MB of characters, or a payload larger than 8 MB of bytes, is refused. The output boxes are readonly text. Filenames and payloads are never written with innerHTML.
A 40 KB PNG icon becomes a data:image/png;base64,… string you can paste into a CSS file. A pasted data URL that starts with data:image/svg+xml is refused. A JPEG data URL that was truncated in email decode fails instead of drawing a broken picture into the page HTML. The preview uses a canvas after a safe decode.
A huge data URL in a stylesheet will hurt parse time. This page will not stop you from copying a 4 MB string, but that is usually the wrong place for a hero photo. Use a file URL or a CDN object for large pictures. Do not paste untrusted Base64 from chat into a page you serve to other people without treating it as untrusted input. This tool is for local conversion, not for sanitizing someone else’s payload on a server.
Decode does not assign img.src to the pasted string. The payload is decoded to bytes, sniffed, turned into a Blob, then decoded again through the same image loader the other tools use. That extra step blocks a data:text/html trick and blocks SVG. If the prefix says image/png and the bytes are JPEG, the page refuses the mismatch.
Whitespace in a pasted string is stripped before atob. That helps with mail-wrapped Base64. It will not repair a string that lost the last twenty characters. A failed atob is a decode error. An empty box is an empty-selection error. There is no “best effort” preview that injects the paste into the DOM.
Image to Data URL is not a second published page. The data URL is the Base64 with a prefix. One engine key, one URL, two output boxes. If you only needed a different file type, convert first. If you only needed dimensions, use the checker. This page is for the embed string and for getting a file back from one.
Encoding reads the original file bytes. Decoding accepts data:image/jpeg, data:image/png, or data:image/webp URLs, or raw Base64 of those types. SVG data URLs are refused.
No. Encode reads the original file bytes.
No. SVG is refused.
No. Encode and decode stay in this browser.
The data URL and the raw Base64 are the same payload with or without a prefix. One page covers both.