Image to Base64
Data-URI encoder with CSS/HTML snippets
Base64 is how you put binary inside text. An image becomes a data URI you can paste straight into an HTML attribute, a CSS rule, a JSON document, or an email template with no separate file to host. The catch is arithmetic: base64 encodes three bytes as four characters, so the payload is about a third larger than the original, and browsers will not cache it the way they cache a real file. This tool shows you the encoded length next to the original file size as a percentage so you can see the cost before you commit. Files above 8 MB are declined with an explanation rather than freezing the tab. It handles images of any type the browser can read, and it never converts the format — the data URI keeps whatever the source was.
Convert images to Base64 data URIs ready to embed in HTML, CSS or JSON — with ready-made <img> and background-image snippets generated for you. Essential for single-file apps and emails.
Private Image to Base64 In Your Browser
Image to Base64 is processed locally with client-side JavaScript. Your files never touch a server, and there is no queue to wait in.
How to use Image to Base64
Feed a file into the Drop an image to encode target; any image type is allowed, and 8 MB is the ceiling.
Read the Data URI tab, which shows the encoded string and its length as a percentage of the original file size.
Switch to the HTML tab for a ready-made <img> tag, or the CSS tab for a background-image rule.
Use the copy button on any tab to put the result on your clipboard.
- Encodes any image format the browser can read, keeping the original MIME type in the data URI header
- Displays the encoded length and its exact percentage of the source file size
- Generates three outputs: the raw data URI, a complete <img> tag, and a CSS background-image rule
- Refuses files over 8 MB and explains why, instead of attempting an encode that would stall the page
- A front-end developer inlining a small SVG or icon so a single HTML file has zero external requests.
- A designer embedding a background texture in an email template, where the client cannot reference a hosted asset.
- A developer building a self-contained offline page that must work from a file:// URL with no server.