Turn an image into a Base64 data URL.
Drop an image here
or click to choose one. It never leaves your device.
Three steps
Drop in the file you want to embed.
A complete data URI is produced, including the correct MIME type prefix.
Paste straight into CSS, HTML, JSON or a config file.
Why this one
The output includes the `data:image/png;base64,` prefix, which is the part people paste without and then spend twenty minutes debugging.
Base64 inflates a file by about a third, and knowing that before you inline a 500KB photo is the useful part.
The encoding is a local read, so a private asset does not have to visit a third party to become a string.
The short version
Inlining an image as a data URI trades an HTTP request for a bigger file and no separate caching, which is a good trade for a two kilobyte icon and a bad one for a photograph. The rule of thumb has survived a decade of changing browser behaviour: if it is small enough that you would not bother optimising it, it is small enough to inline.
Questions
For very small assets, a few kilobytes at most: an icon in a stylesheet, a placeholder, an image inside an email template. Inlining saves an HTTP request, which only matters when the file is tiny.
Base64 represents three bytes with four characters, so it is roughly 33 percent larger by design. That is the cost of making binary data safe to paste into text.
Not separately. They are part of whatever file contains them, so an inlined image is re-downloaded every time that CSS or HTML changes. For anything reused across pages, a normal image URL caches far better.
Inconsistently. Gmail and several other clients block data URIs in images, so hosted URLs remain the reliable choice for email.
Free, and staying free
Thridy is a library of thousands of 3D icons in one consistent style, free for commercial use with no attribution and no account. The tools exist so you never have to upload an image to somebody else's server to resize it.
Keep going
Stamp text or a logo onto an image.
Write text on an image with stroke and shadow.
Combine 2, 4, 6 or 9 images into one grid.
Strip EXIF, GPS and camera data from a photo.
Read the EXIF data hidden inside a photo.
Decode a Base64 string back into an image.