$ convert --img --base64
base64 image converter.
Encode images to Base64 data URIs or decode them back into viewable images.
encode image to base64
drop an image here or click to browse
upload an image to get started.
decode base64 to image
1
2
3
4
5
2
3
4
5
0 / ∞ chars
no image decoded yet.
paste a Base64 data URI and click "decode & preview".
Drag and drop or click to select an image file. The tool converts it to a Base64 data URI that you can embed directly in HTML or CSS.
Yes, paste a Base64 data URI and click decode. The tool renders the image preview and offers download as the original file format.
PNG, JPEG, GIF, WebP, and SVG. The format is detected automatically from the file or data URI header.
Data URI Syntax
A data URI embeds file content directly into HTML or CSS, eliminating extra HTTP requests. The format is:
data:[<mediatype>][;base64],<data>
# Examples
data:image/png;base64,iVBORw0KGgo...
data:image/svg+xml,%3Csvg xmlns='...'/%3E
data:text/plain;base64,SGVsbG8=
When to Use Data URIs
| Scenario | Recommendation | Reason |
|---|---|---|
| Small icons (<5KB) | Use data URI | Reduces HTTP requests, instant load |
| Hero images (>50KB) | Use external file | Data URIs block HTML parsing |
| Email signatures | Use data URI | No external hosting needed |
| CSS background | Small patterns: yes | Large images bloat CSS file |
| Cacheability | Use external file | Data URIs can't be cached separately |
Performance rule: Images under 4KB are good candidates for data URIs. Above that, the base64 overhead (~33%) and blocked parallel downloads make external files faster.
learn more in our detailed guide.
→ read the guide