Which output to use
| Output | Example | Use it for |
|---|---|---|
| Data URI | data:image/png;base64,iVBO… | img src, JSON, JavaScript, anywhere an image address goes |
| CSS background | background-image: url("data:…"); | Icons and small patterns in a stylesheet |
| HTML img | <img src="data:…" alt="…"> | Single-file HTML pages and HTML email signatures |
| Markdown |  | Notes apps that accept data URIs |
| Base64 only | iVBORw0KGgo… | APIs and JSON fields that ask for “base64 image” |
How big is too big?
Every character of Base64 travels with the page or stylesheet it sits in, every time, and is about a third bigger than the file. Under 10 KB of text, inlining usually pays off because it saves a separate request. Between 10 and 100 KB it works but rarely helps. Above that, link to an image file instead. SVG icons are often smallest as Base64 too, but plain SVG text in the CSS is smaller still if your setup allows it.
Worked example: a 1.2 KB icon
A 24 × 24 PNG icon of 1,230 bytes becomes 1,640 characters of Base64. As a CSS background it adds 1.6 KB to the stylesheet and saves one request: a good trade. A 350 KB photo would become about 467 KB of text, blocking the page until it loads, so the tool marks it in red.
Good to know
- The picture type in the data URI comes from the file’s first bytes, not its name, so a PNG saved as “.jpg” is still labelled image/png.
- Gmail and some other email apps block data-URI images; for newsletters, host the image and link to it.
- Shrink the picture first: Resize image to the size it is shown at, then compress it, and the Base64 shrinks with it.
Frequently asked questions
How do I convert an image to Base64?
What is a data URI?
data:image/png;base64,iVBORw0…. Anywhere a picture’s address is expected (an img src, a CSS url(), a JSON field) you can paste a data URI instead, and no separate file is needed.Why is the Base64 bigger than my file?
Should I inline images as Base64 on my website?
Is the picture changed?
How do I turn Base64 back into a picture?
Last updated: 2026-11-26