Global ToolBox

Image to Base64 Converter

Convert an image to a Base64 string or Data URI, or decode a Base64 string back into a viewable, downloadable image — entirely in your browser.

🔒 Processed locally in your browser

Loading…

How to use

  1. Choose Encode to turn an image into Base64, or Decode to turn Base64 back into an image.
  2. In Encode mode, drag and drop an image or click the dropzone to choose a file from your device.
  3. Toggle whether the output includes the "data:" prefix, then copy the resulting string.
  4. In Decode mode, paste a Base64 string or Data URI to preview and download it as an image.

Features

  • Bidirectional: encode images to Base64 and decode Base64 back to images
  • Toggle between a full Data URI and raw Base64 output
  • Instant image preview in both Encode and Decode modes
  • One-click copy and one-click download of the result
  • 100% client-side — your images never leave your browser

Frequently asked questions

What is Base64 image encoding?

Base64 encoding turns binary image data into plain text using 64 printable characters. Wrapped in a "data:image/png;base64,..." Data URI, it can be embedded directly in HTML, CSS, or JSON without a separate image file.

Why does the output start with "data:image/...;base64,"?

That's the Data URI prefix, which tells a browser or app the MIME type of the encoded data so it knows how to render it. You can toggle it off if you only need the raw Base64 payload.

Does Base64 encoding increase file size?

Yes, by roughly 33%, since every 3 bytes of binary data becomes 4 Base64 characters. It's convenient for embedding small images but isn't a compression technique.

Are my images uploaded anywhere?

No. All encoding and decoding happens locally in your browser using the File and Blob APIs. Nothing is sent to a server.

Why does my pasted Base64 string show an error?

Check for extra spaces, line breaks, or missing characters introduced when copying. If it still fails, the string may not represent valid image data even though it's formatted like Base64.

Related tools