Convert images to data URIs for embedding directly in CSS, HTML, or JavaScript. Drag and drop any image file to generate a base64-encoded data URI that eliminates the need for external image files.
Drop an image here or click to browse
Supports PNG, JPG, GIF, SVG, WebP
<img src="data:image/png;base64,iVBORw0KG..." alt="Image">
.element {
background-image: url('data:image/png;base64,iVBORw0KG...');
}
const img = new Image();
img.src = 'data:image/png;base64,iVBORw0KG...';
document.body.appendChild(img);
A Data URI (Uniform Resource Identifier) is a way to embed small files directly into HTML, CSS, or JavaScript code instead of linking to external files. Data URIs use base64 encoding to represent binary data as text.
The format is: data:[MIME-type];base64,[base64-encoded-data]
Data URIs are supported in all modern browsers. IE8+ supports data URIs up to 32KB in size.
Small vector icons embedded directly in CSS or HTML for instant rendering.
Animated GIFs or small PNGs that need to display immediately.
Logos and small graphics in HTML emails to avoid blocked images.
Icons and UI elements in Chrome/Firefox extensions.
Critical UI elements needed before JavaScript loads.
Embed small favicon directly in HTML for offline support.
Any image format: PNG, JPG, GIF, SVG, WebP, BMP, ICO, and more. The tool preserves the original MIME type.
This tool limits files to 10MB to prevent browser performance issues. For best results, use images under 50KB.
No! All processing happens in your browser. Your images never leave your computer, ensuring complete privacy.
Base64 encoding increases file size by approximately 33% because it uses text characters to represent binary data.
Yes, all modern browsers fully support data URIs. Internet Explorer 8+ supports them with a 32KB size limit per URI.
Data URIs don't have separate alt text or file names, so important images should still use regular img tags for SEO.
This website may contain affiliate links. If you click on an affiliate link and make a purchase, we may receive a small commission at no additional cost to you.