Image to Base64 Converter
Turn an image into Base64 text or a data URI. Your image stays on your device.
- Runs in your browser
- No sign-up
- No watermark
Image to Base64 reads an image file and gives you its contents as Base64 text. You get two versions: the raw Base64 string, and a data URI that starts with data: and the image type, which you can paste straight into HTML, CSS or JSON.
Base64 text is about a third larger than the file, so it suits small icons and inline images better than large photos. The conversion happens in your browser and nothing is uploaded.
How to use Image to Base64
- Choose one or more image files, or drop them onto the box.
- Read the size note under each file.
- Select Copy Base64 for the raw string, or Copy data URI for the full data: link.
- Or select Download .txt to save the text as a file.
Frequently asked questions
Is my image uploaded?
No. The file is read in your browser and never sent anywhere.
What is the difference between Base64 and a data URI?
Base64 is just the encoded text. A data URI adds a prefix such as data:image/png;base64, so a browser knows what the data is. Use the data URI in an img src or a CSS url().
Why is the Base64 text bigger than my file?
Base64 stores 3 bytes as 4 characters, so the text is about 33 percent larger than the original file.
Should I inline large images as Base64?
Usually not. It makes the page heavier and the image cannot be cached on its own. It works well for small icons and logos.
Can I convert several images?
Yes. Each file gets its own Base64 and data URI boxes with their own copy buttons.
How do I turn Base64 back into an image?
Use the Base64 to Image tool on this site. Paste the text or data URI and download the picture.
Is there a size limit?
No fixed limit, but very large files are slow. Only the first 200,000 characters are shown on screen. The copy and download buttons still use the full text.