Image to Base64 Converter Online - Free, No Upload
This is the catch-all image encoder. It takes PNG, JPG, WebP, GIF, SVG, BMP and AVIF and gives you the data URI plus a ready HTML tag and CSS rule.
Your browser does the work, so the picture is never uploaded. No size cap, no signup, no cost.
How to Convert an Image to Base64
- Click Select Image and pick any picture.
- The preview and three code blocks load below.
- Copy the block you need, or download it as a text file.
The prefix matches your file automatically. A WebP comes out as data:image/webp;base64,, an SVG as data:image/svg+xml;base64,.
Which Format Is Worth Inlining
Not all image types pay off the same way as Base64. Here is how they stack up.
- SVG - the best pick. It is already text, so the size bump hurts least, and icons stay sharp at any scale.
- PNG - good for flat icons and logos under about 5 KB. See PNG to Base64 for the dedicated page.
- WebP - small to start with, but older browsers will not read it. Check your support target.
- JPG - usually the wrong choice. Photos are big and the encoding adds 33% on top. The JPG to Base64 page covers when it is still worth it.
Your Image Stays On Your Device
Other converters post your picture to a server and send the text back. This one does not. JavaScript reads the file in your browser and prints the string on the same page.
No upload means no copy on someone else's disk, no account, and no email address to hand over. It also means it is quick, because there is nothing to wait for.
What Image to Base64 Costs You in Size
Base64 turns 3 bytes into 4 characters, so expect the string to run about 33% larger than the file. A 4 KB icon lands near 5.4 KB of text.
One inlined icon saves a request and is a clear win. Twenty inlined icons bloat your stylesheet and slow the first paint. Pick a handful, not everything.
Decoding a String Back to a Picture
Got the text and want the image? Base64 to image shows a preview and gives you a download.
For non-image files, file to Base64 handles any type at all, including fonts, zips and spreadsheets.
Common Questions
Which formats does it take?
Anything your browser can open. PNG, JPG, WebP, GIF, SVG, BMP and AVIF all work.
Is my image uploaded anywhere?
No. It is read locally and the string is printed on this page. Nothing goes over the network.
Does encoding shrink the file?
No, the opposite. Base64 is not compression. The string is about a third bigger than the image you started with.