Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Base64 to Image Decoder & Extractor

Paste Base64, a data URI or a whole page source — get every image out of it.

Image No upload Works offline Free, no sign-up

Images are found as you paste. Files: .html, .css, .json, .svg, .xml, .txt, .eml, .mht — up to 64 MB.

Next steps

About the Base64 to Image Decoder & Extractor

Turn Base64 back into pictures. Paste a single Base64 string or data URI — or a whole HTML page, CSS file, JSON response, SVG, e-mail (.eml) or saved web page (.mht) — and the tool finds every embedded image in it, tells you where each one was (line, <img>, CSS url(), JSON key, e-mail attachment) and shows it.

Each image is identified from its own bytes, not from the label in the text, so a “PNG” that is really a JPEG is reported as one, with its size in pixels and bytes. Download the images one by one in their own format, convert them to PNG, JPG or WebP, copy them, or download them all as a ZIP. Identical images are listed once. Everything happens in your browser; nothing is uploaded or fetched.

How to use it

  1. Paste the text into the box, or use Open file for an .html, .css, .json, .svg, .eml or .mht file. Example shows a small HTML snippet with three embedded images.
  2. The images appear below as you paste (for very large texts, select Find images).
  3. Check each card: format, size, where it was found, and any warning such as a wrong label.
  4. Use Download on a card — choose Original or convert to PNG, JPG or WebP — or Download all as ZIP.

Examples

A data URI
Input
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
Result
GIF · 1 × 1 px · 42 bytes — the classic transparent “spacer” GIF.
JSON from an API with escaped slashes
Input
{"user":{"avatar":"data:image\/png;base64,iVBORw0KGgo…"}}
Result
PNG found at JSON “avatar”, saved as avatar.png.

JSON allows “/” to be written as “\/”; the escapes are undone before decoding.

An e-mail saved as .eml
Input
A message with a logo.png attachment and an image inside its HTML
Result
logo.png (from the attachment) and image-2.gif (from the HTML), with where each was found.

Common uses

  • Saving images that a web page, stylesheet or e-mail template embeds as data URIs.
  • Checking what an API returned in a Base64 field — and whether it really is the image type it claims.
  • Getting attachments and inline images out of a saved e-mail or MHTML page.
  • Converting embedded SVG icons to PNG, or WebP images to JPG for older software.

What you can paste

  • Base64 on its own — standard or URL-safe (- and _), with or without = padding, on one line or wrapped (MIME wraps lines at 76 characters). Defined in RFC 4648.
  • Data URIs — data:[type][;base64],data (RFC 2397), Base64 or percent-encoded, in HTML attributes, CSS url(), JavaScript and JSON strings (including \/ escapes), SVG <image href> — and images inside embedded SVGs.
  • Long Base64 strings inside other text — XML, JSON values, scripts — when their first bytes are an image or another known file.
  • E-mails and saved pages — .eml messages and .mht/.mhtml web archives: attachments, inline images and data URIs in the HTML part (MIME decoding by postal-mime).
  • A hexadecimal dump of an image file pasted on its own — an SQL 0x… literal, a PostgreSQL \x… value or hex-editor output (spaces allowed).
  • An SVG document itself, which is shown and can be converted to PNG.

Spotting an image in Base64

The first characters of Base64 encode the file’s first bytes — its signature — so you can often tell the format at a glance:

  • iVBORw0KGgo — PNG (bytes 89 50 4E 47 0D 0A 1A 0A)
  • /9j/ — JPEG (FF D8 FF)
  • R0lGOD — GIF (“GIF8”)
  • UklGR — WebP (“RIFF”, then “WEBP”)
  • Qk — BMP (“BM”)
  • PHN2Zy or PD94bWwg — SVG (“<svg” or “<?xml ”)
  • AAABAA — ICO; JVBERi0 — a PDF, not an image

The tool decodes every candidate and checks those bytes, which is why it can say “labelled image/png, but the data is JPEG”.

Limitations

  • Texts up to 64 MB, up to 1,000 embedded files and 256 MB of decoded data at a time.
  • Images referenced by URL (<img src="https://…">) are not downloaded — the tool never fetches anything from the internet.
  • Previews depend on your browser: TIFF, HEIC and JPEG XL show only in browsers that support them (Safari), PSD, QOI, DDS and JPEG 2000 not at all — those can still be downloaded.
  • SVGs are previewed and converted as images: scripts and external files they reference are not run or loaded.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

Frequently asked questions

How do I convert a Base64 string to a PNG or JPG?

Paste the string (with or without the data:image/…;base64, prefix). When the image appears, choose PNG or JPG under Download and save it.

It says “not a possible length”. What does that mean?

Base64 encodes 3 bytes in 4 characters, so after removing spaces and line breaks its length can never be one more than a multiple of 4. The text was cut off or a character was lost when copying — copy it again from the source.

Why does it say the data is not an image?

The Base64 decoded fine, but its first bytes are not those of any image format — for example a PDF, a font or plain text that was Base64-encoded. The message shows the first bytes so you can recognise what it is.

Is it safe to paste e-mails or company HTML here?

Yes: the text is read by your browser on your device and is never uploaded. SVG images are shown as pictures only, so any script inside them is not run.

How do I turn an image into Base64?

Use the Image to Base64 converter — it makes data URIs, CSS and HTML snippets from your images.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.