Image to Data URI
Convert an image into a complete data URI that starts with data:image and includes the Base64 payload. Drop the URI straight into an HTML img src, a CSS background-image, or a JSON value. All conversion runs in your browser.
Drop an image or click to choose
JPEG, PNG, WebP, GIF, SVG, AVIF, up to 50 MB. Runs in your browser.
OUTPUT FORMAT
METADATA
How it works
By default the tool first removes the camera and editing metadata (EXIF including GPS, XMP, IPTC, comments, and C2PA) from a copy of your image, keeping the pixels and orientation; tick Keep original metadata to encode the file unchanged. It then reads the result with the FileReader API as a data URL. FileReader returns a string of the form data:image/png;base64,XXXX, where everything after the comma is the Base64-encoded file. The tool can show the full URI, strip the prefix to return raw Base64, or wrap it in a CSS background snippet, all in your browser tab.
Processing runs in your browser
All Base64 encoding happens locally in your browser tab using FileReader. Our servers are not involved at any point. You can verify this yourself in your browser's DevTools Network tab.
Frequently asked questions
- Is my image uploaded to make the data URI?
- All data URI generation runs in your browser using FileReader.readAsDataURL, which reads the copy with the metadata removed (or the original file, if you keep the metadata). Our servers are not involved at any point.
- What does a data URI look like?
- A data URI has the form data:image/png;base64,XXXX. The first part is the MIME type, then a comma, then the Base64-encoded contents. The browser treats it like a tiny inline file.
- Where can I use a data URI?
- Anywhere a URL is accepted. Common places include the src attribute of an img tag, the url() value of a CSS background, the href of an anchor for download, and inside JSON payloads.
- Are there limits on data URI length?
- Browsers handle data URIs up to several megabytes, though bundlers and CSS minifiers can struggle past about 2 MB. The Out badge shows the output size, and a note appears once it passes 2 MB.
- Does the data URI work in email templates?
- Most desktop email clients render inline data URIs for images. A few mobile clients block them, so test in your target inbox before relying on inline images for critical mail.
Last reviewed September 30, 2026
Other pages for this tool
Related tools
- Background reading: Complete guide to image tools