Base64 Image Encoder
Convert images to Base64 data URIs and back. Free, no signup, works in your browser.
Click or drag an image here (max 5 MB)
All encoding happens in your browser. No images are uploaded to any server.
About Base64 Image Encoder
This tool converts images to Base64-encoded data URIs and decodes Base64 strings back to viewable images. Drag and drop or select an image file (up to 5 MB) to get the Base64 string, complete data URI, and a ready-to-use HTML img tag. Or paste a Base64 string to preview the decoded image. Data URIs are useful for embedding small images directly in HTML, CSS, or JSON without separate file requests — reducing HTTP round-trips for icons, logos, and thumbnails.
Frequently Asked Questions
What image formats are supported?
All standard web image formats: PNG, JPEG, GIF, WebP, SVG, ICO, and BMP. The tool uses the browser's FileReader API, which handles any format your browser can display.
Why is the Base64 string larger than the original image?
Base64 encoding represents 3 bytes of data using 4 ASCII characters, resulting in a ~33% size increase. For small images (under ~10 KB), the trade-off is worthwhile because you eliminate an HTTP request. For larger images, use regular file hosting.
Can I use data URIs in CSS?
Yes. Use the data URI in a CSS background-image property: background-image: url('data:image/png;base64,...'). This is common for small icons and patterns to avoid extra network requests.