UtilToolkits2025-12-18
TL;DR — Drop an image into the Image to Base64 tool to get a ready-to-paste data:image/...;base64,... string. Inline only for icons under ~2 KB — for larger files, compress first with the Image Compressor and keep using normal src. For raw text Base64 work, the Base64 Converter.
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...
A data URI embeds the entire image as text inside your CSS, HTML, or JSON. The browser never makes a separate HTTP request for that asset — it just decodes the Base64 inline.
<img src="...">, the CSS form for background-image: url("..."), or the raw Base64 for JSON payloads./* Tiny chevron icon — 380 bytes original, 520 bytes Base64
Saves one HTTP request, cost is acceptable */
.dropdown::after {
content: '';
display: inline-block;
width: 12px;
height: 12px;
background: url('data:image/svg+xml;base64,PHN2ZyB...');
}
/* Wrong: 80 KB hero photo inlined — page now 27% bigger
and the image can't be cached or lazy-loaded */
.hero {
background: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABA...');
}
Most "free image to base64" sites upload your image to a server first. That matters for unreleased product shots, internal mockups, or screenshots containing customer data. The UtilToolkits version reads the file with the FileReader browser API and encodes locally. Nothing is uploaded.
No hard limit — but data URIs over ~10 KB are almost always a mistake. Use a normal URL for anything bigger.
The HTML or CSS file containing them is cached, but the image can’t be cached independently. Every page that uses the URI re-downloads it as part of the file.
Usually no — inline SVG markup directly, or use URL-encoded form (smaller than Base64). The SVG to Data URI tool produces the optimal version.
Slightly — search engines can’t index inline images for image search. Use real URLs for content images.