Encode Image to Base64

Output

Decode Base64 to Image

PRACTICAL GUIDE · UPDATED OCTOBER 13, 2026

Convert an image to a data URI—or recover a known image

This tool has two separate tasks: encode a supported image into Base64 text, or decode a pasted image representation into a downloadable image. Use it when a template or API explicitly expects an embedded image value. A normal file URL is often easier to maintain for a reusable website image.

Try a harmless local image

  1. Create a small JPG or PNG containing a shape and the word demo.
  2. Choose that file under Upload Image and select Encode.
  3. Copy the generated value and identify whether it includes a data-URI prefix.
  4. Paste the complete known value into the decoding area.
  5. Decode, download, and open the recovered image.

The final image should show the same demonstration content. This round-trip test is more informative than inspecting the long encoded string. Keep the original while experimenting, and do not use a confidential photograph just to verify that the tool works.

Understand the prefix

A value beginning with data:image/png;base64, describes both the image type and the representation. The encoded bytes follow the comma. Some destinations need the complete data URI; others need only the payload. Check the destination's documented field requirements before stripping the prefix. For bare input, the current client decoder assumes a PNG data URI, so provide the complete appropriate URI when the original type matters.

Troubleshoot a missing result

A value copied incompletely, with extra surrounding JSON, or with a media type that does not match its bytes may fail to display. Start from the generated value for your harmless sample, then compare what changed. Do not assume arbitrary decoded bytes are a valid JPG or PNG. This is not a general-purpose document decoder.

Choose an appropriate delivery method

Embedding Base64 increases the text representation's size and makes an HTML or JSON document longer. If you repeatedly use a large image, a separate file may be more practical. Use the Image Compressor before encoding when a smaller image meets the visual requirement. Browser processing is available, but server fallback requests can upload or decode content on the host; see the privacy policy for retention details.

Base64 is encoding, not encryption. Review the decoded image and choose a suitable sharing destination before sending it.