Image to Base64 Converter
Turn a small image into a Base64 data URI you can paste straight into HTML, CSS or JSON.
Processed on your device. The image is never uploaded.
Choose an image to begin.
What is the Image to Base64 Converter?
The Image to Base64 Converter encodes a picture as a text string called a data URI. Developers paste it directly into HTML, CSS or JSON so that a small icon or logo loads without a separate file request. The encoding is done in your browser; the image is not uploaded.
How it works
The image bytes are converted to Base64 text and prefixed with the image type, producing a data URI. Base64 text is roughly a third larger than the original file, so it suits small images only.
How to use it
- Choose a small image, ideally a few kilobytes.
- Press Copy to copy the data URI.
- Paste it as the src of an image tag or inside a CSS url() value.
Image to Base64 Converter — FAQ
When should I embed an image as Base64?
For very small images such as icons, where avoiding an extra request is worth the slightly larger text.
Why not use it for large photos?
The text is about a third bigger than the file and cannot be cached separately, which slows pages down.
Is Base64 a form of encryption?
No. It is only an encoding and anyone can decode it back to the image.