Overview
What this tool does
Encode an image into a Base64 data URI you can paste directly into HTML, CSS, or JSON, and decode Base64 back into a downloadable image. It gives you ready-to-use CSS and HTML snippets, shows the size overhead, and runs entirely in your browser so the file is never uploaded.
The basics
What is a Base64 data URI?
Base64 is a way to represent binary data (like an image) using only printable text characters. A data URI wraps that encoded data with a small header so a browser knows what it is:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...
The image/png part is the MIME type, and everything after the comma is the Base64-encoded file. Drop this string into an <img src="..."> or a CSS url(...) and the image renders with no separate file request.
The right tool for the job
When to use Base64 images
Good uses
- Tiny icons and logos embedded in CSS to avoid an extra request
- Single-pixel or simple background images
- Embedding an image inside JSON for an API response
- Self-contained HTML emails or single-file documents
- Inlining an SVG or small asset in a code snippet
Poor uses
- Large photos — the 33% size increase hurts and the page can't cache the image separately
- Images reused across many pages — a normal file gets cached once and reused
- Anything where total page weight matters more than request count
Why Base64 is bigger
The size overhead
Expect about +33%
Behind the scenes
Privacy and how it runs
Your file never uploads
Common questions
How do I convert an image to Base64?
Drag your image into the upload area (or click to choose). The Base64 data URI appears instantly, along with copy-ready CSS and HTML snippets. The image is encoded in your browser, not uploaded.
How do I use a Base64 image in CSS?
Use it as a background: background-image: url("data:image/png;base64,...");. Our CSS snippet tab gives you this line ready to paste.
How do I decode Base64 back to an image?
Switch to Base64 to Image mode and paste the string (with or without the data: prefix). You'll see a preview and a download button to save it as a file.
Which formats are supported?
Any image your browser can read: PNG, JPG, GIF, WebP, and SVG. The data URI preserves the original MIME type so it renders correctly when embedded.
Does Base64 reduce image quality?
No. Base64 is a lossless text representation of the exact same bytes — the image quality is identical. It only changes how the data is stored (text instead of binary), not the pixels.