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
In Encode mode, upload an image to get its Base64 string, Data URI, HTML tag, and CSS background-image code.
Click Copy on any output format to copy it to your clipboard.
Switch to Decode mode to paste a Base64 string or Data URI and preview the image.
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
Image Resizer
Resize images to exact pixel dimensions or by percentage while preserving aspect ratio and quality
Image Compressor
Compress images up to 90% smaller while maintaining visual quality, perfect for web optimization
Image Format Converter
Convert images between PNG, JPG, WebP, and other formats with quality control and batch support
Image Cropper
Crop images to custom dimensions with a visual drag-and-drop editor and preset aspect ratios