Image to Base64 Converter (Data URI)

Convert any image to a Base64 string or data URI for HTML, CSS or JSON, with ready-made img and background-image snippets. Runs in your browser.

About Image to Base64 Converter (Data URI)

Pick any image and this tool converts it into a Base64 string, the text form that lets an image travel inside HTML, CSS, JSON or an email without a separate file. The file is read in your browser and never uploaded, so private photos and screenshots stay on your device.

Choose the output you need: a full data URI (data:image/png;base64,…) for an img src or a JSON field, a raw Base64 string for APIs that ask for the payload alone, a ready-made HTML img tag, or a CSS background-image rule. The preview and file details show the original size and how much larger the Base64 text is, which is roughly one third more than the file.

How to use it

  1. Drop an image onto the upload area or click to browse.
  2. Pick an output format: Data URI, Raw Base64, HTML img or CSS background.
  3. Check the preview and size information.
  4. Click Copy and paste the result into your code or document.

Questions

Why is the Base64 output larger than my image?

Base64 stores every three bytes of the file as four text characters, so the text is about 33% bigger. It is convenient for embedding but not a way to compress an image.

Is my image uploaded anywhere?

No. The file is read with the browser FileReader API and converted locally. Nothing is sent to a server.

Should I embed large images as Base64?

Usually not. Base64 is best for small icons, logos and placeholders. Larger images load faster as separate files that the browser can cache.

More Image & Favicons tools

Home · All Tools · Blog