Free online image to Base64 converter. Convert PNG, JPG, or WebP images to Base64 encoded strings for use in CSS, HTML, or JSON APIs. Runs in your browser.
Base64 encoding converts an image's binary data into a text string that can be embedded directly in HTML, CSS, or JSON without requiring a separate image file or network request. This technique is used for small images, icons, and inline SVGs.
This tool converts any image to its Base64 representation and provides the complete data URI format ready to paste into your code. A data URI like data:image/png;base64,iVBOR... can be used anywhere an image URL is expected.
Base64 encoded images are about 33% larger than the original binary file because of the encoding overhead. For this reason, Base64 is best suited for small images (under 10-20KB) where eliminating the HTTP request outweighs the size increase.
A data URI (data URL) is a URL scheme that embeds data directly in the URL string rather than linking to an external resource. Format: data:[mediatype];base64,[data]. For example, data:image/png;base64,iVBOR... can be used as an img src value to display an image without an HTTP request.
Base64 encoding increases the data size by approximately 33%. A 10KB image becomes about 13.3KB as Base64. For small images, this overhead is acceptable. For large images, the size increase outweighs the benefits of inlining.
Any image format your browser can display can be encoded: PNG, JPG, WebP, GIF, SVG, ICO, and more. The data URI includes the correct MIME type automatically.