loot.tools

Image to Base64

Upload an image to get a Base64 data URI you can paste directly into HTML, CSS, or JSON. Choose plain data URI, a CSS background-image rule, or an HTML img tag, then copy with one click.

Convert an image to a Base64 data URI you can drop straight into HTML or CSS. The file is read locally and never uploaded.

What this tool does

Upload an image and it gets encoded as a Base64 data URI, a long text string that contains the whole image. Pick the output you want: a raw data URI, a ready-to-paste CSS background-image rule, or a full HTML img tag. Copy it with one click and drop it straight into your code.

When inlining an image helps

Embedding a small image as Base64 saves an HTTP request, which can speed up the first paint for tiny icons, logos, or placeholder graphics. It's handy when you can't reference an external file, like in a self-contained HTML email or a single-file demo. It also lets you store an image inside a JSON payload or a CSS file.

When to avoid it

Base64 encoding makes a file about 33 percent larger than the original binary, and inlined images can't be cached separately by the browser. For anything beyond small assets, a normal image file with its own URL is the better choice. As a rule of thumb, inline images under a few kilobytes and link to everything bigger.

© 2026 loot.toolsYour data stays in your browser.