How to use Image to Base64
- Select or drop one or more images (PNG, JPG, GIF, WebP, SVG, ICO…).
- Keep “Original file” or re-encode and resize to make the string shorter.
- Press “Convert to Base64”.
- Copy the data URI, the HTML tag, the CSS rule or the Markdown snippet – or download it as a text file.
About this tool
Base64 represents binary data with 64 text characters, so it grows the file by about a third: a 30 KB icon becomes 40 KB of text. Inlining is worth it for tiny images such as icons and placeholders because it saves a separate request, but for photos and large graphics a normal image file loads faster and can be cached.
With “Original file” the exact bytes of your image are encoded and the MIME type is detected from the content, not just the file name. Re-encoding as WebP or JPG with a maximum width is a quick way to get a much shorter string.
Frequently asked questions
What is a data URI?
A data URI (data:image/png;base64,…) contains the whole file in the URL itself, so a browser can show the image without downloading a separate file.
Is there a size limit?
Browsers handle data URIs of several megabytes, but for performance keep inlined images small – ideally under 10 KB.
How do I turn Base64 back into an image?
Use our Base64 to Image tool: paste the string and download the decoded picture.
Are my images uploaded to a server?
No. The whole process runs inside your browser with JavaScript. Your images never leave your device, which also means the tool keeps working if you go offline after the page has loaded.
Is this tool really free?
Yes. There is no sign-up, no daily limit, no watermark and no paid tier. The site is supported by advertising shown on the page, not by charging for the tools.