Texterfly

Base64 to Image Converter

Paste a Base64 string and see the decoded image in one click — free, instant, and 100 % browser-side.

Paste Base64 String

Drop a .txt file to load0 chars

Preview

Image preview

Paste a Base64 string on the left to decode it

Base64 to Image Converter: Decode Any Base64 String to PNG, JPG, SVG & More

Texterfly's Base64 to Image Converter is the fastest, most private way to decode Base64 strings back into viewable image files — all inside your browser, no server involved. Whether you are debugging a database BLOB, inspecting an API response, or recovering an embedded asset from a JSON file, paste your string and the image appears within milliseconds.

Supported formats include PNG, JPEG/JPG, WebP, GIF (including animated), and SVG. Full Data URIs (data:image/png;base64,…) are auto-detected, and raw Base64 strings are handled through the built-in format selector.

How to Convert Base64 to an Image (Step-by-Step)

  1. Paste the Base64 string. Copy the code from your database, code editor, or API client and paste it into the left panel. You can paste a complete data:image/… Data URI or a raw Base64 string.
  2. Let the auto-detector work. If your string starts with data:image, the format and MIME type are read automatically. For raw strings, the tool tries to identify the format from the first bytes (magic bytes).
  3. Force the format if needed. When auto-detection cannot determine the type, a yellow banner appears. Select the correct format (PNG, JPG, WebP, GIF, or SVG) from the dropdown to force a render.
  4. Clean corrupted strings. If the image fails to render, click Clean String to strip whitespace, newlines, and tabs that are often introduced by terminals or email clients.
  5. Download or copy. Once the image appears, click Download to save the file, Copy Image to put it on your clipboard, or Copy URI to copy the full Data URI string.

Features & Supported Formats

Supported Image Formats

  • PNG — lossless quality, transparency support.
  • JPEG / JPG — ideal for photos, smaller file sizes.
  • SVG — scalable vector graphics, renders as XML.
  • WebP — modern compression, smaller than PNG/JPEG.
  • GIF — supports animated Base64 strings.

Developer-Focused Features

  • Magic-byte auto-detection — identifies PNG, JPEG, WebP & GIF from the raw string.
  • Resolution display — exact pixel width × height after decode.
  • File size estimate — calculated before render using Base64 length.
  • MIME type badge — shown in the preview header.
  • Copy Data URI — one-click copy of the full data:image/… string.
  • Drag & drop .txt files — drop a text file containing a Base64 string.
  • 100 % private — everything runs client-side; nothing is uploaded.

Understanding Base64 & Data URIs

Base64 is a binary-to-text encoding scheme that represents binary data (such as an image file) as a string of ASCII characters. It is widely used to embed images directly in HTML, CSS, JSON, and database records — avoiding a separate HTTP request for each asset.

A Data URI wraps a Base64 payload in a standardized scheme the browser can render directly as an image source:

data:[<media type>][;base64],<data>
  • data: — the URI scheme.
  • image/png — the MIME type; tells the browser the file format.
  • ;base64 — declares the encoding.
  • <data> — the Base64-encoded bytes of the image.

Identifying raw Base64 by magic bytes — when no Data URI prefix is present, the first few decoded characters reveal the format. PNG files always begin with iVBORw0KGgo, JPEGs with /9j/4AAQ, WebP with UklGR, and GIFs with R0lGOD. This tool uses those signatures to auto-select the correct format before you have to.

Troubleshooting: Why Is My Image Not Showing?

  • Missing Data URI header. Raw Base64 strings won't display without the data:image/…;base64, prefix. Use the Force Format dropdown or let the auto-detector pick it up.
  • Whitespace & newlines. Copying from a terminal, PDF, or email often inserts line breaks. Click Clean String to remove all whitespace.
  • Truncated string / broken padding. A valid Base64 string must have a character count divisible by 4. If characters were cut off, the image cannot be decoded. Check your source.
  • Wrong format selected. If you forced PNG but the data is actually a JPEG, it will fail. Check the raw string's first characters to identify the real format.
  • Non-image data. Base64 strings representing PDFs, fonts, or audio will not render here. This tool supports image MIME types only.

Common Use Cases

Debugging API Responses

REST and GraphQL APIs sometimes return image data as Base64. Paste the value here to verify the image looks correct before writing decoding logic in your app.

Database BLOB Inspection

If your database stores images as BLOB columns or Base64 text fields, copy the value and decode it here to confirm the stored data is intact.

HTML / CSS Embedded Images

Data URIs are used to inline background images in CSS or tags. Decode them here to inspect the original asset without touching the stylesheet.

Email Attachment Debugging

MIME emails encode attachments as Base64. Extract the payload from the raw MIME source and decode it to recover the attachment.

JSON &amp; Config File Assets

Some config formats (Jupyter Notebooks, Swagger specs, theme files) embed thumbnails or icons as Base64. Visualize them instantly without writing a script.

QR Code &amp; Canvas Data URLs

Libraries like qrcode.js and HTML produce Base64 PNG strings via toDataURL(). Drop them here to preview and download the exported image.

Frequently Asked Questions

How do I identify the image type from a raw Base64 string?

Check the first characters of the string: PNGs start with iVBORw0KGgo, JPEGs with /9j/4AAQ, WebP with UklGR, and GIFs with R0lGOD. This tool does this automatically — the auto-detected MIME type appears in a confirmation message inside the input panel.

Can I convert a Base64 PDF to an image?

No — this tool decodes image MIME types only. A Base64-encoded PDF (application/pdf) will not render here. You need a separate PDF viewer.

Is there a file size limit?

There is no enforced limit. The tool is constrained only by your browser's available RAM. Strings up to ~20 MB decode instantly; very large strings (50 MB+) may cause a brief pause.

How do I encode an image file to Base64?

Use our companion tool: Image to Base64 Converter. It converts any image file to a Data URI string in one click.

What does the "Copy URI" button do?

It copies the full Data URI string (data:image/png;base64,…) to your clipboard, so you can paste it directly into an HTML src attribute, a CSS background-image rule, or your code.

Explore All Tools

82 free tools — no signup required

All 82 tools are free · No signup · No ads