Image to Base64
Turn images into data URIs, HTML img tags or CSS url() values you can paste into code.
Files
Preview
Add a file to see a preview.
How it works
- Add one or more images.
- The encoded text appears under each image.
- Copy the data URI, the HTML tag or the CSS value, or download it as a text file.
FAQ
- What is a data URI?
- It is the image written out as text, so it can sit inside a web page or a stylesheet instead of being a separate file.
- Why is the text longer than the file?
- Base64 turns every 3 bytes into 4 characters, so the text is about a third bigger than the image. The exact increase is shown for each file.
- When is it a good idea?
- For very small images such as icons. Large images make a page slower to load, because they cannot be cached on their own.
- Is the image changed?
- No. The original bytes are encoded as they are, with no recompression and nothing removed.