FREE WEB TOOL

Convert Images to and from Base64 Data URLs

Convert between image files and Base64 Data URLs.

Convert

🔒 Images and text are processed in this browser and are not uploaded.

How to use it

Convert an image into a Base64 image Data URL, or turn an image Data URL back into a downloadable image. It is useful for checking small embedded assets or inspecting an image Data URL you received.

  1. For image → Base64, choose an image up to 8 MB and run the conversion.
  2. For Base64 → image, paste a complete data:image/...;base64,... Data URL.
  3. Check the preview, then copy the Data URL or download the restored image.
Image → Base64
Source image up to 8 MB
Base64 → image
Requires a complete image Data URL
Decoded size
Up to 12 MB
Download
Uses the image type declared in the Data URL

Turn a small PNG into a Data URL before embedding it

A PNG can produce a string beginning with data:image/png;base64,.... Preview it first, then use the value in an image src or another supported place if embedding is appropriate.

Base64 text is larger than the original binary file, so it is usually a poor fit for large photos or many assets. The decode field expects the full image Data URL, not only the raw Base64 payload.

Data URLs are handy for small self-contained assets

A demo HTML file, test email or tiny CSS icon can sometimes be easier to move around when the image is embedded rather than stored as a separate file.

This page is image-specific

Use the general Base64 text tool for ordinary text, JSON or other non-image content. This converter expects image MIME information when restoring a file.

Keep the Data URL header intact

The image/png or image/jpeg portion tells the tool what kind of file to restore. Removing the header leaves only a payload that this page will not accept.

Large images are usually better as normal files

Embedding big assets increases document size and makes source code difficult to inspect. A normal image file and URL are often simpler and cache more effectively.

Treat the encoded text as the image itself

Anyone who can read the Base64 Data URL can reconstruct the image, so do not paste confidential images into public source code or shared messages merely because they look like text.

Related references: DPI, PPI & px · Paper sizes · Aspect ratios