Embed small images directly in HTML, CSS, JSON or email templates. Drop in an image and copy the encoded string or a ready-made snippet.
How to use the Image to Base64 tool
- Choose or drop an image.
- Copy the Base64 data URI, or the ready-made HTML or CSS snippet.
- Paste it into your code.
Frequently asked questions
When should I use Base64 images?
For small icons and images under a few KB, inlining saves an HTTP request. For larger images a normal file is better, because Base64 makes the data about 33% bigger and it can't be cached separately.
Is my image uploaded?
No. The encoding uses your browser's FileReader, so it all happens locally.
Related tools
Favicon Generatorfavicon.ico plus Apple and Android icons.
Base64 to ImageDecode a Base64 string back into an image file.
Compress ImageShrink photos to an exact size in KB or MB.
Image ConverterConvert between JPG, PNG, WebP, GIF, BMP, AVIF and SVG.
Resize ImageExact pixel sizes and social media presets.
Remove EXIF DataStrip hidden GPS location and camera info from photos.