Image to Base64 Converter
Encode any image as Base64 and copy it as a data URI, CSS background or HTML <img> tag.
🔒 Private: runs in your browser, no upload
How to convert an image to Base64
- Choose or drop an image (PNG, JPG, SVG, WebP, GIF or ICO).
- Pick the output format: data URI, raw Base64, CSS or HTML.
- Click Copy and paste it into your code.
When to use Base64 images
Embedding small images (icons, logos, placeholders under ~10 KB) as data URIs saves an HTTP request and is handy for emails, single-file HTML and CSS. Base64 makes files about 33% larger, so keep large photos as normal image files.
Frequently asked questions
Is my image uploaded?
No. The file is read and encoded with JavaScript in your browser.
Why is the Base64 string bigger than the image?
Base64 represents every 3 bytes as 4 text characters, so the output is about 33% larger than the original file.
How do I use a data URI in HTML?
Put it in the src attribute: <img src="data:image/png;base64,...">. Choose “HTML img tag” to get it ready-made.
Can I convert Base64 back to an image?
Yes — use the Base64 to Image decoder.