About the Image to Base64 Converter
The Image to Base64 Converter turns an image file into a Base64 data URI — a long text string that contains the entire image. You can paste it directly into HTML, CSS or JavaScript, so the browser does not need to request a separate file.
How to use it
- Choose an image.
- Click Convert to Base64.
- Copy the data URI or the ready-made CSS background rule.
When to inline images
- Icons and logos: tiny images that would otherwise be a separate request.
- Emails: many email clients block external images, but inline data URIs usually display.
- Single-file pages: embedding everything keeps a page self-contained.
The trade-offs
Base64 makes text about 33% larger than the original binary, and it cannot be cached separately by the browser. That makes it great for small images and a bad idea for large photos. As a rule, inline anything under about 10 KB and load anything larger as a normal file.
Tips
- Use the Image Compressor or Image Resizer first so the inlined image is as small as possible.
- Use PNG for logos with transparency and JPEG for photos before encoding.
- Keep the
data:image/png;base64,prefix — it tells the browser the image type.
Who it is for
Web developers, email designers and anyone building a self-contained HTML file.
Privacy
Encoding happens in your browser — nothing is uploaded.
Frequently asked questions
background-image: url("...") rule.