Frequently Asked Questions

Common questions about converting images to Base64 — privacy, data URIs, file sizes, and email embedding. If your question is not answered here, send it to us and we will add it.

Basics

What is a Base64 image?

A Base64 image is an image file (PNG, JPG, SVG, WebP, or GIF) encoded as a plain-text string of ASCII characters. The string can be embedded directly in HTML, CSS, or JSON as a data URI, so the browser renders the image without downloading a separate file.

How do I convert an image to Base64?

Upload or drag your image into the converter on our homepage, and the Base64 string is generated instantly in your browser. You can copy it as a plain Base64 string, an HTML <img> tag, or a CSS background-image declaration.

Can I convert a Base64 string back to an image?

Yes. Paste the Base64 string into one of our decoders — Base64 to Image, Base64 to PNG, Base64 to JPG, Base64 to WebP, Base64 to GIF, or Base64 to SVG — and preview or download the decoded image. Decoding also runs entirely in your browser.

Privacy & safety

Is it safe to convert images to Base64 here? Do you upload my images?

All conversion runs entirely in your browser using client-side JavaScript. Your images are never uploaded to our servers, never stored, and never sent anywhere — the tool even works offline once the page has loaded. This makes it safe for confidential screenshots, logos, and private assets.

How can I verify that my image is never uploaded?

Open your browser's developer tools (right-click → Inspect → Network tab), then convert an image. On this site you will not see any request carrying your file — the only activity is the page itself. The strongest test: go fully offline (airplane mode) after the page loads. The converter still works, which is impossible if a server is doing the encoding.

Sizes & formats

Why is the Base64 string larger than my original image?

Base64 encoding represents every 3 bytes of binary data as 4 ASCII characters, which increases the size by roughly 33%. This overhead is normal. That is why Base64 is best for small images such as icons, logos, and avatars — not large photos.

Which image formats can I convert?

You can convert PNG, JPG/JPEG, SVG, WebP, and GIF to Base64, and convert Base64 strings back to images. Pick the exact tool from the Converters menu in the footer — for example PNG to Base64 or SVG to Base64.

What is the maximum image size I can convert?

Because conversion happens in your browser, the practical limit depends on your device's memory rather than our servers. Files up to a few megabytes convert fine on most machines. Keep in mind the ~33% size overhead — very large images produce very long Base64 strings that slow down page rendering.

Using Base64 in HTML, CSS & email

How do I display a Base64 image in HTML?

Use a data URI in the src attribute of an <img> tag:

<img src="data:image/png;base64,your-base64-string" alt="Description">

Replace image/png with the correct MIME type for your format (image/jpeg, image/svg+xml, image/webp, or image/gif). Our converter outputs this tag ready to paste.

How do I use a Base64 image in CSS?

Use it as a background-image value:

background-image: url("data:image/png;base64,your-base64-string");

This is common for small background patterns, icons, and sprites where you want to avoid an extra HTTP request.

Do Base64 images work in email?

Support is inconsistent. Base64 inline images work in many desktop and webmail clients, but Gmail and some Outlook versions strip or block data URIs in email HTML. For emails, hosting the image on a CDN and linking to it is still the more reliable approach; Base64 is better suited to web pages.

When should I use Base64 instead of a regular image file?

Use Base64 for small, frequently reused assets — icons, logos, UI elements — where saving an HTTP request or keeping everything in a single file (HTML email templates, single-file demos, JSON APIs) matters. For large photos or images served across many pages, regular image files with browser caching are more efficient.

How do I convert an image to Base64 in JavaScript?

Use the FileReader API's readAsDataURL() method on the selected file:

const file = fileInput.files[0];
const dataUri = await new Promise((resolve, reject) => {
  const reader = new FileReader();
  reader.onload = () => resolve(reader.result);
  reader.onerror = reject;
  reader.readAsDataURL(file);
});

dataUri is now the full data URI — for example data:image/png;base64,iVBOR... — ready to paste into an <img> tag, CSS or JSON. If you would rather not write code, our converter produces the same output with a drag and drop.

Concepts & performance

What is the difference between a data URI and a raw Base64 string?

A data URI is the complete, self-describing form: data:image/png;base64,iVBOR.... The data: scheme tells the browser this is inline data, image/png is the MIME type, and everything after base64, is the payload. A raw Base64 string is only that payload — shorter and easier to store, but you must add the scheme and MIME type yourself before a browser or CSS file will accept it. Our converter outputs both.

Does Base64 slow down a website?

It can. A Base64 image is roughly 33% larger than the original file, and unlike a separate file it cannot be cached independently or fetched in parallel — every page that uses it re-parses the whole string. For a few small icons the impact is negligible; for large photos it can noticeably delay first render. Rule of thumb: inline tiny assets, keep large images as normal files.

Should I Base64-encode SVG images?

Usually not. SVG is already text, so it does not need encoding to be embedded — you can inline the markup directly, or use a URL-encoded data:image/svg+xml URI, which stays readable and compresses well. Base64 works anywhere a data URI works, but for SVG it adds roughly 33% bloat with no benefit. Reserve Base64 for binary formats like PNG and JPG (for those, try our SVG to Base64 page only when you genuinely need the encoded form).

Choosing a tool

Wondering how this site differs from upload-based converters? We broke down the difference between online vs. in-browser Base64 converters and compared Image2Base64 with the most popular alternatives.

Still have a question?

Email us at — real questions from users get answered and added to this page.