Image to Base64 Online
Image to Base64 data URI online (PNG, JPEG, WEBP, GIF, BMP, SVG) with ready CSS, HTML and JSON snippets, preview and metrics. No upload: all in your browser.
100% local processing — your files are processed in your browser and are never sent to a server.
Examples
Each row describes a file the tool accepts (type and size) and the format of the result. Upload a similar file to reproduce the scenario.
| Input file | Result (illustrative format) |
|---|---|
| PNG 0.1 MB (small icon) | Data URI in the data:image/png;base64,... format ready to paste into CSS or HTML |
| JPEG 0.8 MB (photo) | Base64 with an overhead badge of roughly +33% and the encoded size displayed |
| SVG 0.2 MB (vector logo) | Text data URI in the data:image/svg+xml;base64,... format (vector file, small output) |
| PNG 4.9 MB (image near the 5 MB limit) | Accepted (below the 5 MB limit); snippet available in all 5 modes: Data URI, Base64, CSS, HTML and JSON |
Frequently asked questions
What is a data URI?
It is a URI that embeds the file content directly in the text, in the data:image/png;base64,... format, with no external file or HTTP request. It is the format used to embed the image in CSS (background-image), HTML () or JSON.
Why does Base64 increase the size by roughly 33%?
Base64 encodes each group of 3 bytes as 4 text characters, so the result takes about 4/3 (roughly +33%) of the original size, plus the data URI prefix. The tool displays that overhead in the result badge.
Why is there a 5 MB limit?
The 5 MB per-file limit keeps the conversion fast and avoids giant strings that break editors, browsers and systems consuming the data URI. Files up to that limit are accepted and processed 100% locally.