Image to Base64
Select an image file to convert it to a Base64 encoded string. Toggle the data URI prefix for ready-to-use CSS/HTML output. All processing happens in your browser.
About Image to Base64
This tool converts images to Base64-encoded strings entirely in your browser. No data is uploaded to any server.
- Data URI: With the prefix enabled, the output is ready to use in CSS
background-imageor HTML<img src="...">. - Raw Base64: Without the prefix, you get the raw encoded string.
- Supports JPEG, PNG, GIF, WebP, SVG and other browser-supported image formats.
Embedding an image as a data URI removes a request and adds about a third to its size, because base64 needs four characters for every three bytes. That trade is worth taking for something small and always needed, such as an icon in a stylesheet or a logo in an email, and not worth taking for a photograph. An embedded image also cannot be cached separately, so it is downloaded again with every copy of the file that carries it.
Related tools
Is the markup fighting you?
Escaped entities, mangled encodings and content that renders one way in the CMS and another on the page usually mean something in the pipeline is guessing. We build front ends and the publishing path behind them, so what you write is what a visitor sees.
Talk to us about your site