Image to Base64 Converter
Convert an image to Base64 and get a data URI, a CSS background, an img tag or Markdown, with the size increase shown. The file never leaves the browser.
Free · No sign-up · Your inputs stay in your browser
Input
Convert an image to Base64
Output
Choose an image
Base64 makes a file about 33% bigger and it cannot be cached separately from the page that embeds it. Inline only small images, such as icons under a couple of kilobytes; serve the rest as files.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
When inlining pays
A data URI saves a request but costs about a third more bytes, cannot be cached on its own, and has to be downloaded again with every page or stylesheet that includes it. Over HTTP/2 and HTTP/3 extra requests are cheap, so inline only tiny images: a small icon, a placeholder, an image in an HTML email that must not load remote content.
SVG is different
For SVG, a URL-encoded data URI is smaller than Base64 and stays readable. The SVG to data URI tool on this site produces that form.