Image to Base64
Encode an image as a Base64 data URI for CSS, HTML or JSON.
Fill in the form and press “Encode image” to see the result here.
How to use it
- 1Select your image, or drag and drop it onto the upload area.
- 2Adjust the options if you need something other than the defaults.
- 3Press the button. The image is processed on your device - nothing is uploaded.
- 4Download the result, or drop in another file to do it again.
About the Image to Base64
The data URI can be used directly as an img src, a CSS background, or a value inside JSON. Nothing is uploaded - the bytes are read locally and encoded in the page.
Base64 adds about 33% to the size, and an inlined image is re-downloaded with every copy of the file containing it. That is a good trade for a small icon on the critical path and a bad one for anything larger than a few kilobytes.
The size limit here is 8 MB, because the encoded string has to be held in memory as text.
Questions people ask
Is your image uploaded to a server?
No. This tool runs entirely in your browser using standard web APIs, so your image never leaves your device. You can confirm it by opening your browser's network panel while the tool runs, or by disconnecting from the internet after the page has loaded.
Is it free, and do I need an account?
Yes, it is free, and there is no account, no sign-up and no watermark on the result. The project is funded by optional donations.