Add your image
Drag a .png, .jpg, .svg, .webp or .gif onto the drop zone, click to browse, or paste a screenshot with Ctrl + V.
Runs 100% in your browser — nothing is uploaded
Turn any PNG, JPG, SVG, WebP or GIF into a Base64 data URI and a ready-to-paste <img>, CSS background-image or JSX snippet. Shrink it first, preview it live, copy the result.
Drop images here, or click to browse
Up to 20 at once — or just paste one with Ctrl + V.
Add an image above and its Base64 output appears here instantly.
Rendered as a CSS background-image
Three steps, no account, no upload. Everything below happens on your own machine.
Drag a .png, .jpg, .svg, .webp or .gif onto the drop zone, click to browse, or paste a screenshot with Ctrl + V.
Cap the width and re-encode to WebP or JPEG before encoding. Base64 adds roughly 33% on top, so every byte you save off the source saves more in the string.
Switch between raw Base64, a data URI, an <img> tag, a CSS rule, a JSX component, Markdown or JSON — then copy it or download it as a file.
A data URI removes one network request, but the image can no longer be cached on its own and it inflates whatever file it is pasted into. Use it deliberately.
srcset or a CDN in front of them.<svg> markup instead, it is smaller and stylable.Base64 turns every 3 bytes of binary data into 4 ASCII characters. The encoded result is always about a third larger than the file you started with.
| Source image | Base64 length | Verdict |
|---|---|---|
| 1 KB favicon | ~1.4 KB | Inline it |
| 8 KB icon or logo | ~11 KB | Inline it |
| 40 KB illustration | ~54 KB | Borderline |
| 150 KB screenshot | ~200 KB | Keep it a file |
| 1 MB photo | ~1.37 MB | Keep it a file |
The converter shows these numbers for your actual image, and flags each one as ideal, borderline or too heavy to inline. If a file lands in the wrong bracket, cap its width or switch it to WebP in the options above — that usually moves it a whole bracket down.
Everything people usually ask about encoding images as Base64.
No. The conversion runs entirely in your browser using the FileReader and Canvas APIs. Your image never leaves your device, so screenshots, client work and unreleased assets stay private. You can load this page once, go offline, and it still works.
PNG, JPG/JPEG, SVG, WebP, GIF, BMP, ICO and AVIF, as long as your browser can decode them. SVG files stay vector and are passed through untouched unless you explicitly pick a raster output format.
Base64 represents every 3 bytes of binary data as 4 ASCII characters, so the output is about 33% larger than the source. The tool shows the exact source size, encoded size and overhead for every image you add.
In HTML, drop it into the src of an <img> tag. In CSS, wrap it in url() for background-image. The HTML and CSS tabs generate both snippets for you, already filled in with the right MIME type and dimensions.
Yes — drop or select up to 20 at a time. Click any image in the list to switch the output to it, or use Copy all to grab the current output format for every image in one go.
Yes, as long as you leave the format on Keep original — the original bytes are encoded verbatim. Choosing a raster format or a max width redraws the image on a canvas, which keeps only the first frame.
It can. An inlined image cannot be cached on its own, is re-downloaded whenever the surrounding HTML or CSS changes, and adds weight to render-blocking CSS. It saves one request, which only pays off for very small assets.
The tool accepts images up to 15 MB, but that is a safety cap, not a recommendation. Anything above a few tens of KB is usually better served as a normal image file — the badge on each row tells you which side of the line you are on.
Use our Base64 to Image tool. Paste a Base64 string or a full data URI and it decodes it back into a downloadable file.
Yes. Completely free, no sign-up, and no limit on how many images you convert.
Other browser-based utilities from SeeB4Coding.