Create data URLs
Convert small PNG, JPG, WEBP, or SVG files into data URLs for sample HTML or temporary test code.
🔒 Browser-side processing
Convert image files to and from Base64 data URLs.
Guide
Move small icons, test images, and data URLs between files and strings for CSS, HTML, and API samples.
Convert small PNG, JPG, WEBP, or SVG files into data URLs for sample HTML or temporary test code.
Decode a received Base64 image string in the browser to inspect what it actually contains.
Image reading and conversion happen in the browser; the file or Base64 string is not uploaded by this tool.
Workflow
Examples
Input
icon.png (1.2 KB)
Output
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
Paste it straight into CSS or HTML and the image renders with no extra request.
Troubleshooting
Base64 adds roughly 33% to the original size. Embedding images larger than a few dozen KB bloats the HTML or CSS and slows first render. Reserve it for small icons.
A data URL lives inside the document, so it cannot be cached as a separate image. Keep images reused across pages as normal files.
Review
Base64 is usually longer than the original binary file. Large data URLs can make HTML and CSS heavy.
A prefix such as data:image/png;base64 should match the actual image format to avoid unexpected browser or API behavior.
Related