Base64 to Image — Preview & Download Base64 Images

Paste a Base64 data URL to preview the image in your browser and download it as PNG or JPG.

About Base64 to Image — Preview & Download Base64 Images

Base64 to Image Tool decodes Base64-encoded image strings into a visible image preview and downloadable file. Use it to inspect data URIs from HTML/CSS, decode API responses, and extract images from source code.

How to Use

  1. 1Paste the Base64 image string (with or without the data URI prefix) into the input.
  2. 2The image is rendered instantly in the preview area.
  3. 3Click "Download" to save the image file.

Features

  • Instantly preview and download any Base64-encoded image
  • Accepts data: URI format and plain Base64 strings
  • Supports JPEG, PNG, WebP, GIF, and SVG encoded images
  • Fully browser-based — no server upload
01

Understanding Base64 Image Encoding

Base64 is a method of encoding binary data — like image files — into a text string that can be safely transmitted or embedded in text-based formats like HTML, CSS, and JSON.

How Base64 Encoding Works for Images

An image file is binary data — a sequence of bytes. Many text-based formats cannot carry raw binary bytes safely. Base64 solves this by converting every 3 bytes of binary data into 4 printable ASCII characters using a 64-character alphabet (A-Z, a-z, 0-9, +, /). The result is a text string that can be placed anywhere a string is valid. For example, a 10KB PNG file becomes roughly a 13.3KB Base64 string. When you paste that string into this tool, it reverses the process: it converts the Base64 text back to binary bytes and renders the resulting image in your browser.

Data URI Format vs. Plain Base64

A Base64-encoded image can appear in two forms. The first is a plain Base64 string — just the encoded characters with no prefix, starting with characters like iVBOR (for PNG) or /9j/ (for JPEG). The second is a data URI, which prepends a MIME type header: data:image/png;base64, followed by the Base64 string. Data URIs are used directly in HTML src attributes and CSS background-image values. This tool accepts both formats — it automatically strips the data URI prefix if present and decodes the raw Base64 string. If you are unsure which format you have, paste it in and the tool will handle it correctly.

Common Sources of Base64-Encoded Images

You will encounter Base64-encoded images in several typical development contexts: HTML files that embed small icons inline to avoid HTTP requests (using data: URIs in img src attributes), CSS files with background images encoded as data URIs, API responses from services that return image data as Base64 strings rather than file URLs, JSON payloads from IoT devices or mobile apps that capture images, HTML emails that embed images to avoid broken image links from blocked external URLs, and JavaScript applications that use canvas to generate image data and export it as a Base64 data URL.

02

When to Use Base64 Images

Base64 embedding is a trade-off between eliminating HTTP requests and increasing file size. Knowing when it helps and when it hurts is essential.

When Base64 Embedding Makes Sense

Base64 is most effective for small images — typically under 5-10KB — where the overhead of an HTTP request outweighs the size increase from encoding. Inline SVG icons, small UI decorations, loading spinners, and favicons are good candidates. Embedding them as data URIs means the browser does not need to make a separate network request for each asset, which can improve initial page load performance on high-latency connections. Base64 is also essential for HTML emails, where external image URLs are frequently blocked by email clients, making data URI embedding the only reliable way to include images that will display for all recipients.

When to Avoid Base64 Embedding

For images larger than 10KB, the 33% size overhead of Base64 encoding typically outweighs the benefit of saving a single HTTP request, especially with HTTP/2 and HTTP/3 which handle multiple parallel requests efficiently. Large background images, hero photos, and product images should always be served as separate files with proper caching headers rather than embedded as data URIs. Base64-embedded images also cannot be cached by the browser separately from the HTML or CSS file that contains them — every time the page or stylesheet is re-downloaded, the full embedded image is re-transmitted, even if the image has not changed.

FAQ

What is a data URI?
A data URI embeds file data directly in a URL using the format data:[MIME type];base64,[data]. It is commonly used to embed small images in HTML and CSS.
Do I need to include the data:image/ prefix?
The tool accepts both the full data URI (with prefix) and a plain Base64 string.
What can I do with the downloaded image?
The downloaded image is a normal file you can open, edit, or upload anywhere.
How do I get a Base64-encoded image to convert?
Base64-encoded images appear in several contexts: HTML or CSS source code as data: URIs (data:image/png;base64,ABCD...), JSON API responses that embed images, database BLOB fields stored as Base64, email attachments in raw MIME format, and image export functions in some applications. Copy the Base64 string (everything after the comma in a data: URI), paste it into this tool, and the original image is reconstructed and displayed.
What is the maximum Base64 image size this tool can handle?
Browser-based tools handle Base64 strings up to several megabytes without issues on modern hardware. Very large images (10 MB+ original = 13+ MB Base64 string) may cause browser slowness during decoding. If you need to convert very large images, consider using a server-side tool or command-line utility like base64 (Linux/macOS) or CertUtil (Windows).

Found a bug or something not working as expected?

Report a bug →