Useful for inlining tiny images (logos, icons, decorative backgrounds) into CSS or HTML to skip an extra network request. Best for assets under 5 KB; larger images bloat your HTML/CSS payload more than they save in HTTP requests. Alternative: use a build tool plugin (`url-loader` in webpack, `?inline` in Vite) for automatic inlining at build time.
A small PNG icon as an inline CSS background:
.icon {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...");
width: 24px;
height: 24px;
}Last updated: 2026-04-27