Image to Base64 Converter

Convert an image to Base64 text you can paste straight into HTML, CSS or JSON. Your image stays on your device.

Updated November 2026 Formulas tested

Quick answer: To convert an image to Base64, drop the file in and copy the result. Choose a data URI (data:image/png;base64,…), plain Base64, an HTML img tag or a CSS background rule. The conversion happens in your browser.

When Base64 images are useful

  • Embed small icons in HTML or CSS without an extra network request.
  • Send an image inside a JSON API request.
  • Include images in emails or single-file HTML pages.

Base64 text is about 33% larger than the original file, so it suits small images. For large photos, use a normal image file.

Output formats

  • Data URI: the full string starting with data:image/…;base64,.
  • Base64 only: just the encoded data.
  • HTML: a ready-made <img> tag.
  • CSS: a background-image rule.
Your files stay private. This tool runs entirely in your browser. Nothing you choose or type is uploaded to a server. See our privacy policy.

Frequently asked questions

Is Base64 the same as encryption?

No. It is only an encoding and anyone can decode it.

Why is the text longer than my file?

Base64 uses about 33% more characters than the original bytes.

Which images work?

PNG, JPG, GIF, WebP, SVG, BMP and anything else your browser can read.

Is my image uploaded?

No. It is converted in your browser.

Press Esc to close