Image to Base64
Convert an image into a Base64 data URI to embed it directly in CSS or HTML — or paste Base64 to turn it back into a downloadable image. Everything runs in your browser.
Convert the other way
Need to go from Base64 back to an image? Use the dedicated page:
How to convert an image to Base64
- Drop in an image (or switch to Base64 → Image and paste Base64).
- Copy the Base64 data URI — toggle the data: prefix on or off.
- Paste it into your CSS or HTML, or decode it back to an image.
About image Base64 encoding
Encoding an image as Base64 turns it into a text string you can embed directly in a CSS background, an HTML img tag or a JSON payload — no separate file request needed. It’s handy for small icons, inline email images and data URIs, though it makes the data about 33% larger, so it’s best for small assets.
This converts both ways entirely in your browser: drop an image to get its data URI, or paste a data URI / Base64 string to preview and download the image. Nothing is uploaded, so private images stay on your device.
Frequently asked questions
What is a data URI?
A data URI embeds a file’s bytes directly in a URL as Base64, like data:image/png;base64,… — you can use it as an image source or CSS background with no separate file.
Why is the Base64 bigger than the file?
Base64 represents 3 bytes with 4 ASCII characters, so the text is about 33% larger than the original image. It’s best for small assets like icons.
Can I convert Base64 back to an image?
Yes. Switch to Base64 → Image, paste a data URI or raw Base64, and preview and download the decoded image.
Is my image uploaded?
No. Both directions run entirely in your browser, so your image or Base64 never leaves your device.