Drop your image
In the Files and images section, drop a PNG, JPG, GIF, WebP or SVG (up to 100 MB).
Drop a picture and get its Base64 string or a data URI ready to paste into HTML, CSS or JSON. The image stays on your device. Jump to the image converter.
100% private — everything is converted in your browser and nothing is uploaded.
100% private — everything is converted in your browser and nothing is uploaded.
Keep going with your result in another tool. Nothing is uploaded.
In the Files and images section, drop a PNG, JPG, GIF, WebP or SVG (up to 100 MB).
Keep the data: prefix for a data URI, or untick it for the raw Base64. Tick URL-safe if you need it.
Copy the result and paste it into your img tag, style sheet or JSON.
To convert an image to Base64, drop the picture on the file box in the Files and images section below the text converter. The Base64 string appears right away, with the data: prefix by default so it is a ready-to-use data URI, and you can copy it with one click. The picture is read inside your browser and is never uploaded.
A data URI stores a file directly inside a web address, in the form data:image/png;base64, followed by the Base64 of the file. A browser shows it like a normal image, without making a separate request. This is a complete, valid one: a 1 by 1 red pixel PNG. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4nGP4z8DwHwAFAAH/iZk9HQAAAABJRU5ErkJggg==
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4nGP4z8DwHwAFAAH/iZk9HQAAAABJRU5ErkJggg==" alt="">
.icon { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4nGP4z8DwHwAFAAH/iZk9HQAAAABJRU5ErkJggg=="); }
Base64 makes a file about 33% larger and the browser cannot cache the image separately from the page. For large photos, keep normal image files and compress them first. Shrinking the picture before converting, for example with the image compressor, is the easiest way to keep the string short.
The conversion runs in your browser. What you type, paste or drop is never uploaded, which matters when the text holds tokens, personal data or internal files.
More utilities that also run without leaving your browser.