Image to Base64
Upload any image file and get a Base64 data URI. Use it directly in HTML img src, CSS background-image, or API payloads.
Drop an image here or click to upload
Supports PNG, JPG, GIF, WebP, SVG
Why convert images to Base64?
Base64-encoded images can be embedded directly in HTML, CSS, JSON, and email without separate file requests. This reduces HTTP requests for small icons, enables offline-capable web apps, simplifies email template images, and makes it easy to store images in databases or pass them through APIs. Note: Base64 adds ~33% size overhead, so inline embedding is best for small images. For text encoding, see Base64 encoder. More tools in the data tools category.
Multiple output formats
Output as a data URI for HTML src attributes, Base64 only for APIs, a CSS background-image rule, or a complete HTML img tag.
Drag & drop upload
Drag an image file onto the tool or click to browse — no file size limit for browser-based conversion.
Size comparison
The tool shows the original file size and the Base64 string size so you can decide whether inline embedding is worth the overhead.
Image format comparison & Base64 size overhead
Base64 encoding increases file size by approximately 33% (4 bytes out for every 3 bytes in). Use the most appropriate format for your use case.
| Format | MIME type | Best for | Base64 overhead |
|---|---|---|---|
| PNG | image/png | Lossless compression, transparency, icons, screenshots | ~33% larger |
| JPEG | image/jpeg | Photographs, complex images with many colours | ~33% larger |
| SVG | image/svg+xml | Logos, icons, illustrations — infinitely scalable | ~33% (or use inline SVG directly) |
| WebP | image/webp | Modern web — 25-35% smaller than JPEG/PNG | ~33% larger (but smaller source) |