What is Base64 Image Encoding?
Base64 encoding converts binary image data into an ASCII string that can be embedded directly in HTML, CSS, or JSON. Instead of referencing an external image file with a URL, the entire image is contained in the data URI: data:image/png;base64,iVBORw0KGgo...
This technique eliminates an HTTP request for the image, which can improve performance for small images like icons and logos. However, the Base64 string is about 33% larger than the original binary file, so it should only be used for images smaller than ~5KB.
FAQ
Will Base64 images work in all browsers?
Yes. Data URIs have been supported in all major browsers (Chrome, Firefox, Safari, Edge) for many years. They also work in emails and CSS files.
Is there a file size limit?
There's no technical limit in our tool, but browsers may have limits on the length of data URIs in certain contexts. For best performance, use Base64 encoding only for images under 5KB–10KB.