Image to Base64
Encode images as data URIs
What is Image to Base64?
Encode any image as a Base64 data URI so you can paste it directly into HTML, CSS, emails, or JSON payloads without a separate file request. Output comes in three flavours: a data URI ready for src attributes, a raw Base64 string, and a CSS url() wrapper. Note: Base64-encoded images are about 33% larger than the binary — good for tiny icons and inlined assets, not for large photos.
How do I use Image to Base64?
- Drop an image onto the upload zone.
- Choose an output flavour: Data URI, Raw Base64, or CSS url().
- Copy the encoded string, or download it as a text file.
When should I use Image to Base64?
Inlining small images (≤ 10 KB) as Base64 avoids an HTTP request and can be worth it. For larger images it's nearly always better to load them normally. To go the other way — convert an existing Base64 string back to an image — use Base64 to Image.
What is a base64 image?
A base64-encoded image is a plain-text representation of an image file, suitable for embedding directly in HTML or CSS via a data: URI — no separate HTTP request required.
Should I base64-encode images on my website?
Only for small images (under ~4 KB). Larger images bloat HTML/CSS and slow down first paint. Use normal <img> tags for anything bigger.
Which formats are supported?
Any image your browser can read — PNG, JPG, WebP, GIF, SVG, BMP, ICO. The output preserves the original MIME type in the data URI.
Is my file uploaded anywhere?
No. Everything runs in your browser. Your files never leave your device, and there is no server component for this tool.