Base64 Image Encoder & Decoder
Convert images to Base64 data URIs and decode Base64 strings back to images. Free online tool for embedding images in HTML and CSS. 100% client-side.
Frequently Asked Questions
What is a Base64 image?
A Base64 image is an image file encoded as a Base64 text string, typically formatted as a data URI (data:image/png;base64,...). This allows images to be embedded directly in HTML, CSS, or JSON without separate file requests.
When should I use Base64 images?
Use Base64 images for small icons, logos, and UI elements (under 10KB) to reduce HTTP requests. Avoid it for large images as Base64 increases file size by roughly 33%. It is ideal for email templates, single-file HTML, and inline CSS backgrounds.
Does Base64 encoding increase image size?
Yes. Base64 encoding increases data size by approximately 33% because it represents 3 bytes of binary data using 4 ASCII characters. For small images this trade-off is worth the reduced HTTP requests; for large images, use regular file references.
What image formats does this tool support?
This tool supports any image format your browser supports, including PNG, JPEG, GIF, SVG, WebP, and AVIF. The tool detects the MIME type automatically and generates the correct data URI prefix.