PNG, JPEG, GIF, WebP, SVG — processed locally, never uploaded.
About Base64 Image Encoding
A data URI embeds an image directly inside HTML, CSS or JavaScript as Base64 text, removing the need for a separate file and HTTP request. That is genuinely useful for small icons in a single-file HTML report, email signatures, quick prototypes, favicons, or embedding a logo in a script-generated page. The trade-off is size: Base64 inflates the data by about 33%, and embedded images cannot be cached separately, so it is the wrong choice for large photos on a normal website.
This converter reads the image with your browser’s FileReader — nothing is uploaded — and can optionally downscale it to a maximum width and re-encode it as PNG, JPEG or WebP using an off-screen canvas. The size readout shows original versus encoded size so you can judge whether embedding is sensible. For decoding text the other way, see the Base64 Encoder / Decoder.
How to Use This Tool
<img> tag, or a CSS background-image rule.Common Use Cases
- HTML email signatures. Embed a small logo directly in the signature so it renders without an external image request — no more broken-image icons or "download pictures" prompts.
- Inlining small UI assets. Icons and tiny decorations under a few KB can live inside the stylesheet, removing HTTP requests from the critical path.
- Self-contained documents. Single-file HTML reports, offline documentation and email templates need images that travel with the file.
- Quick prototypes and CodePens. Embed test images directly in a demo instead of hosting them somewhere first.
- PDF and canvas workflows. Libraries like jsPDF accept data URIs directly — convert once here and paste into the script.
Good and Bad Uses
- Good: icons under ~10 KB, single-file HTML reports, email signatures, offline pages, CSS sprites replacement.
- Good: embedding a small logo in a PowerShell/HTML monitoring report so it renders without a web server.
- Bad: photos and hero images on a public site — 33% larger, uncacheable, slows first paint.
- Tip: resize to the display size and use WebP or JPEG for photographic content before embedding.