Image to Base64 / Data URI Converter

Select your image; instantly get the Base64 code, a CSS <code>background-image</code>, and ready-made HTML <code>&lt;img&gt;</code> code.

Runs 100% in your browser — your image is never uploaded to a server.
Drop the image here, or click to select
JPG, PNG, WebP, SVG and GIF — single file

Try This Next

Finished here? These might be your next step.

Frequently Asked Questions

A Data URI is a format that Base64-encodes a file's binary data (here, an image) directly into a URL (data:image/png;base64,...). It's useful when you want to embed an image in CSS or HTML without a separate file request — especially for small icons/logos, it reduces the number of HTTP requests.

Base64 encoding converts every 3 bytes of binary data into 4 characters of text, which increases the size by about 33%. Using a Data URI for large images can save a separate file request but may increase total page size; it's better suited for small icons/sprites.

Last updated: