Skip to content

Image to Base64

Base64

Drop an image here

or click to browse · PNG, JPEG, GIF, WebP, SVG

Raw Base64 string only

Output
About this tool

Image to Base64 Converter

Encode any image to a Base64 string or Data URI in your browser — upload a file or enter a URL, and copy the result instantly.

Common use cases
Embed icons in HTML/CSSCreate self-contained HTMLStore thumbnails in JSONSend images via text APIsBuild CSS Data URIs

PNG, JPEG, GIF, WebP, and SVG images are supported, both via file upload and URL. The output format (plain Base64 or Data URI) is the same regardless of image type.

Base64 Only outputs just the raw encoded string. Data URI prepends a media type header (e.g. data:image/png;base64,) so the string can be used directly in HTML img src attributes, CSS background-image values, or JSON payloads that expect a Data URI.

Base64 encoding increases file size by approximately 33% because it encodes every 3 bytes of binary data as 4 ASCII characters. This overhead is the trade-off for representing binary data as plain text.

Base64 is best for small images (under ~10 KB) where you want to reduce HTTP requests or embed an image directly in HTML, CSS, or JSON. Avoid it for large images due to the size overhead and the fact that Base64 images cannot be cached separately by browsers.

Yes. All encoding happens locally in your browser using the FileReader API. No image data is uploaded to any server.