Image to Base64 Converter

Drop an image to get its Base64 code in the format you need, or switch tabs to turn Base64 text back into an image.

Drop an image here, paste orChoose file🔒 Files never leave your device

How to convert an image to Base64

  1. Drop an image or click Choose file.
  2. Choose the output: data URI, plain Base64, a CSS background-image, an HTML <img> tag or Markdown.
  3. Click Copy or download the code as a text file.

When to inline images as Base64

  • Small icons and logos in CSS or HTML emails, to save an extra request.
  • Embedding images in JSON, configuration files or single-file HTML pages.
  • Avoid it for large photos: Base64 is about 33% bigger than the file and cannot be cached separately.

Decoding Base64

Paste a data URI, plain Base64 or even a whole CSS or HTML snippet into the second tab. The tool detects PNG, JPEG, GIF, WebP, BMP or SVG from the bytes, shows a preview and lets you download the file.

Frequently asked questions

Is it free and private?

Yes. It is free, needs no sign-up and runs entirely in your browser, so your files are never uploaded.

Why is the Base64 text bigger than the image?

Base64 uses 4 characters for every 3 bytes, so it is roughly 33% larger.

Is my image uploaded?

No. The file is read with your browser’s FileReader and never leaves your device.

Does it work on a phone?

Yes, in any modern mobile browser. The result is saved to your downloads folder.

Related tools