$ 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

Uploaded image preview

upload an image to get started.

decode base64 to image
1
2
3
4
5
0 / ∞ chars
Decoded image
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

ScenarioRecommendationReason
Small icons (<5KB)Use data URIReduces HTTP requests, instant load
Hero images (>50KB)Use external fileData URIs block HTML parsing
Email signaturesUse data URINo external hosting needed
CSS backgroundSmall patterns: yesLarge images bloat CSS file
CacheabilityUse external fileData 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