Image to Base64
Read in your browser · the file is never uploaded
Encodes an image as a Base64 data URI you can paste directly into CSS or HTML, with no separate file. The encoding is of the original bytes, so the image is not re-compressed.
How to use the image to base64
A data URI embeds the file in the document, which removes one network request. That used to be a meaningful optimisation and mostly is not any more: HTTP/2 and HTTP/3 multiplex requests over one connection, so the cost of a second file is far lower than it was under HTTP/1.1 where six connections was the limit.
Base64 costs about 33% in size — three bytes become four characters — and that is inherent to the encoding, not an implementation detail. It also costs you caching, which is the bigger problem. A separate image is cached once and reused across every page; an embedded one is re-downloaded with every page that contains it and re-parsed each time. For an icon used on one page that is fine. For a logo on every page it is strictly worse.
Where it genuinely wins: a small icon inside a CSS file, an image in an HTML email where external images are blocked by default, an SVG placeholder that must render before anything else loads, or a single self-contained file with no assets alongside it.
A rule of thumb from practice: under about 4 KB it is usually worth embedding, over about 10 KB it usually is not, and in between it depends on how often the page is loaded. And for SVG specifically, consider skipping Base64 entirely — a URL-encoded SVG in CSS is smaller than the Base64 of the same file, because SVG is text and mostly survives percent-encoding intact.
Questions
Base64 turns three bytes into four characters, so about 33% larger. That is inherent to the encoding.
It saves a request, which mattered under HTTP/1.1. With HTTP/2 and 3 the gain is small, and you lose caching.
Small icons in CSS, images in HTML email where external ones are blocked, and single self-contained files.
No. The original bytes are encoded, so the image is identical to the file you chose.
No. Everything happens in your browser — you can load the page, go offline, and it still works.