Image to Base64

Convert any image file to a Base64 encoded data URI string for embedding directly in HTML or CSS

Drop an image here or click to browse

PNG, JPG, WEBP, BMP, GIF

How to Use This Tool

1

In Encode mode, upload an image to get its Base64 string, Data URI, HTML tag, and CSS background-image code.

2

Click Copy on any output format to copy it to your clipboard.

3

Switch to Decode mode to paste a Base64 string or Data URI and preview the image.

4

Download the decoded image with one click.

About This Tool

Image to Base64 converts any image into a Base64-encoded string, Data URI, HTML <img> tag, or CSS background-image value — ready to paste into your code. Upload an image and instantly get all four output formats with copy buttons. The reverse mode decodes Base64 strings back into viewable, downloadable images. File stats show the original size, Base64 size, dimensions, and type. All processing runs locally in your browser.

Frequently Asked Questions

Base64-encoded images can be embedded directly in HTML, CSS, or JSON without separate file requests. Useful for small icons, email templates, and reducing HTTP requests.

Yes. Base64 encoding increases size by approximately 33%. It's best for small images (under 10KB). For larger images, regular file URLs are more efficient.

The decoder works with both raw Base64 strings and full Data URIs (data:image/...). If it's valid image data, it will render and be downloadable.

Share This Tool

Related Tools

Back to Image Tools