Skip to content
MyImageToolbox

Image to Base64

Client-side

Encode images as Base64 data URIs with ready-to-paste CSS and HTML, or decode Base64 back into an image.

Runs 100% in your browser · This tool saves nothing in this browser

Drag and drop your image here

or

JPG, PNG, WebP, GIF, BMP, AVIF, HEIC, SVG · up to 10 MB per file

Your images are processed in your browser and are not uploaded. You can also paste an image with Ctrl+V.

What does Image to Base64 do?

Base64 is a way of writing binary data, such as an image, using only plain text characters. An image encoded this way can be placed directly inside HTML, CSS, JSON, Markdown or an e-mail template as a data URI (data:image/png;base64,…), with no separate file to host or link. This tool converts images to Base64 and back, entirely in your browser.

Image → Base64

Drop an image (JPG, PNG, WebP, GIF, SVG and more) and you instantly get four ready-to-copy versions: the full data URI, a CSS background-image declaration, an HTML <img> tag with the correct width and height, and the raw Base64 string for APIs that expect it without the prefix. The file's bytes are encoded exactly as they are, with no recompression, so the decoded image is identical to the original. For very large images the text boxes show the beginning only, to keep the page responsive, and the full text is available as a download.

Base64 → Image

Switch to the second tab and paste a data URI or a bare Base64 string – for example one copied from a stylesheet, an API response or a database field. The tool decodes it, recognises the real image format from its first bytes, shows a preview and lets you download it with the right file extension. URL-safe Base64 (with - and _) and missing padding are handled automatically.

When to use data URIs

Inline images save an HTTP request, which helps for tiny icons, e-mail templates and single-file HTML documents. They are about 33% larger than the original file and cannot be cached separately, so for big photos a normal image file is usually the better choice.

Private by design

Encoding and decoding run locally. Nothing you drop or paste is uploaded, so you can safely use internal screenshots or assets from client projects.

Frequently asked questions

Is there a size limit?

Up to 10 MB per image. Larger data URIs are impractical in code anyway.

Can I use the result in an e-mail?

Many e-mail clients block data URI images, so test it first, or attach the image instead.