Encode an image as Base64
This tool converts any image into a Base64 data URL you can embed directly in your code. Choose a file and you get the raw data URL plus ready-made CSS background and HTML img snippets, each with a copy button. The file is read locally in your browser, so your image is never uploaded anywhere.
When to use Base64 images
Embedding a small image as Base64 saves an extra network request, which can speed up a page for icons, logos, and tiny graphics. It is also handy for inlining images in emails, single-file HTML pages, and CSS. For large images the encoded string gets long, so Base64 is best kept for small assets.
Frequently asked questions
How do I convert an image to Base64?
Click choose file and pick an image. The Base64 data URL appears instantly, along with copyable CSS and HTML snippets.
Which image formats are supported?
PNG, JPG, GIF, SVG, WebP, and any other format your browser can read as an image.
Is my image uploaded to a server?
No. The file is read locally with the browser's FileReader, so the image never leaves your device.
Should I Base64-encode large images?
It is best for small assets. Large images produce very long strings and are usually better served as normal image files.