You can upload up to 50 images (max 5MB each) as JPG, PNG, BMP, WEBP, GIF or SVG.
Drag and drop images here or click
Base64 image encoder
Base64 Image Encoder is a simple and free online tool that quickly and easily encodes your image.
Image to Base64
Base64 image encoder is a tool that converts image to Base64 encoded string.
For instance, you can convert PNG to Base64.
After you select your image, you will immediately get Base64 encoded plain text, Base64 encoded image for HTML usage and Base64 encoded image for CSS background attribute.
Besides raster images Base64 encoding (JPG, PNG, BMP, WEBP, GIF), you can also encode vector images such as SVG.
Common usage of Base64 for image encoding
- Embedding images into HTML code
- Embedding images into CSS code
Image to Base64 conversions supported:
The tool can Base64 image encode many file formats:
- JPG to Base64
- PNG to Base64
- BMP to Base64
- WEBP to Base64
- GIF to Base64
- SVG to Base64
Image to Base64 online
The tool converts image to Base64 online, in a browser, without the need to download any tool to your machine.
That way you can Base64 encode images immediately, whether you need to encode an image just once or you do that on daily basis.
img src with Base64
A common use case for Base64 encoded images is to put them into "img src" element inside HTML code.
"src" attribute in that case should contain Base64 encoded image prefixed with a text like data:image/jpeg;base64,
.
However, this tool will generate the whole "img" element for you, so you can just adapt it if needed and put into your HTML code directly.
See the examples below.
css background image with Base64
Another common use case for Base64 encoded images is to use them for CSS backgrounds.
Pass Base64 encoded image into url prefixed with a text like data:image/jpeg;base64,
.
However, this tool will generate the whole CSS "background" attribute for you, so you can just put that into your CSS code directly.
See the examples below.
Base64 image example
This Base64 image example shows how a sample image looks like before encoding and after encoding.
Since encoded text from images can be very long, for this example we will use a very small image.
Image example:
Base64 encoded: iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAMAAADzapwJAAABsFBMVEVHcEz//bXvoBPKbAXAYQj+/tz/vi/WfhDfhAr5qBT/wy++Wgu2IBz2phX/53D/uCPxhgDTdgX/wCjNbwXqmxH7rBbTdwbGZwj/2VP9shjNbwbufwTRdQX/zz7//8vTeQf0kQDggQW2WArrhQTkhQbkhwbsgwH8wBXFZw3KbAX0phD2jwDPcwbHagb/7oX+51b/+qH3kwD+9HHxgw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