- Home
- Image to Base64
Convert an image to Base64
Drop an image and get its Base64 text, or a complete data URI ready to paste into a CSS rule, an HTML attribute or a JSON file.
JPG, PNG, WebP, AVIF, GIF, BMP · up to 30 images at once · or paste with Ctrl+V
Choose images- Processed in your browser by default
- Free, no account
- Metadata (GPS) removed
How to do it
Drop your image
JPG, PNG, WebP, AVIF, GIF or BMP.
Choose the output
Raw Base64 for an API, or a data URI for HTML and CSS.
Copy or download
One click copies the text; it can also be saved as a .txt file.
When Base64 is useful
A data URI embeds the image in the page or the stylesheet, so the browser needs no extra request. It is handy for a small icon, a placeholder or an email signature; it is a poor choice for a large photo, because the text is about a third heavier than the file and it cannot be cached separately.
Watch the size
Base64 increases the weight by roughly 33%. Compress and resize the image first: a 20 KB icon becomes about 27 KB of text, which is acceptable, while a 2 MB photo becomes 2.7 MB inside the page.
Frequently asked questions
What is a data URI?
A single string that contains both the format and the image itself, in the form data:image/png;base64,….
Is the image quality affected?
No. The bytes of the image are only encoded as text; the file itself is unchanged.
Is there a size limit?
The browser can handle several megabytes, but avoid embedding images above a few hundred kilobytes in a page.
Are my images uploaded?
No, the conversion happens on your device.