Image to Base64 Converter
Upload an image, get a Base64 data URI ready to paste into HTML, CSS, or JSON.
Last updated
🔒 Your files never leave this device. It all happens in your browser, which is told to block this page from sending anything to other websites. Try it with airplane mode on: it still works. Check for yourself
Sent to other websites from this page: 0
Drop an image here, or click to choose one
How to convert an image to Base64
- Choose or drop an image.
- Pick the output: data URI, raw Base64, a CSS rule or an HTML tag.
- Click Copy and paste it into your code.
About this tool
A Base64 data URI embeds an image's actual bytes as text, right inside HTML, CSS, or JSON — no separate file or network request needed. Handy for small icons, inline email images, or quick prototypes; for anything large, an ordinary file reference is still faster to load.
Nothing is uploaded anywhere — the conversion happens entirely in your browser tab.
Questions about Base64 images
What is a data URI?
A way to put an image’s bytes straight into HTML or CSS as text, starting with data:image/png;base64, so no separate file is needed.
When should I use a Base64 image?
For small icons, inline images in HTML emails and quick prototypes. Large images are better as normal files, because Base64 is about a third bigger and can’t be cached separately.
How do I use it in CSS?
Choose CSS to get a ready-made background-image rule with the data URI inside url().
Is the image uploaded?
No. The image is read and converted in your browser, so it never leaves your device.