Drop files here, or click to browse
One or many images, up to 20 MB each · or paste with Ctrl+V
Shrink before encoding (shorter Base64)
How to use
Add images
Drop one or more images up to 20 MB each, paste one with Ctrl+V, or type an image URL and click Load URL. Small icons and logos suit Base64 well.
Shrink if needed and pick the output
Open Shrink before encoding to resize or convert to WebP or JPG, then choose Data URI, Raw Base64, CSS, HTML, Markdown, JSON, XML or JS.
Copy or download the code
Click Copy, or Download .txt, then paste the result into your stylesheet, page, API request or source code. With several images, Download all as JSON saves every one.
Why Image to Base64 Converter
- Encode one image or many as Base64 data URIs for inline embedding.
- Eleven outputs, from data URI and CSS to HTML favicon, JSON, XML and JS.
- Optional resize and re-encode before encoding, so the string is much shorter.
- Paste with Ctrl+V, load from a URL, copy the result or download it as a .txt file.
When Base64 images help and when they hurt
Inlining an image as Base64 removes one HTTP request, but the image can no longer be cached separately and it makes your HTML or CSS about a third heavier. That trade is only worth it for small files. The tool shows a note under each image: green for small files that inline well, amber for borderline ones and red for files that are better kept as normal images.
| Situation | Base64 inline? | Why |
|---|---|---|
| Small icon or logo under about 4 KB | Often yes | Saves a request, overhead is tiny |
| Image used on many pages | No | A separate file is cached once, inline data is downloaded with every page |
| Photos over about 20 KB | No | 33 percent larger, and blocks rendering of the file it sits in |
| API or JSON payload that requires Base64 | Yes | The format needs text, not binary |
| HTML email | Usually no | Many email clients do not show data URI images |
| Single-file HTML demos or offline pages | Yes | Everything stays in one file |