Image to Base64 Converter
Drop an image to get its Base64 text, data URI, CSS background-image and HTML img tag. The file never leaves your computer; it is converted in your browser.
This tool runs entirely in your browser; what you enter is never sent to our servers.
How to use it
- Drag an image in or press Choose file.
- Pick the format you need: data URI, plain Base64, CSS, HTML or Markdown.
- Press Copy and paste the code into your page or email.
What it is for
Base64 turns a binary file into text made only of letters, digits and a few symbols. As a data URI (data:image/png;base64,…) an image can be embedded in HTML, CSS, JSON or an email template without a separate file. The text is about a third larger than the file (every 3 bytes become 4 characters) and cannot be cached separately by the browser, so it suits small icons, logos and email images; large photos load faster as normal files. The file type is read from the file's first bytes, not its extension, so the right MIME type is written even for a misnamed file. Files up to 10 MB are converted.