Quality slider and target-size search with side-by-side comparison. Metadata is stripped by default.
Image to Base64
Encode an image as Base64 text you can paste into HTML, CSS, Markdown or JSON.
Loading tool…
How to use image to base64
Drop an image or paste one from the clipboard.
Pick the output: data URI, bare Base64, CSS, an HTML img tag, Markdown or JSON.
Copy it, or download it as a text file.
What this tool does
- Encodes the original file bytes exactly, with no re-compression.
- Detects the MIME type for the data URI, including SVG and ICO.
- Adds width and height to the HTML img tag so the page does not shift while it loads.
- Shows how much bigger the Base64 text is than the file.
How the result is verified
The Base64 text is decoded back into bytes and compared with the original file before it is shown.
Frequently asked questions
When should I inline an image as Base64?
For tiny icons, email templates or single-file HTML where an extra request is worse than a slightly bigger page. For anything over a few KB a normal image file is usually faster.
Does this change the image quality?
No. The exact bytes of your file are encoded. Decoding the text gives back an identical file.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
PNG, JPEG, and WebP conversion with explicit transparency handling and per-file batch results.
favicon.ico, PNG, Apple touch and Android icons from one logo
Dummy images of any size as PNG, JPG, WebP or SVG