Skip to content
← Back

Base64 to Image Online Tool

Media
Runs locally · Not uploaded

Free online Base64 to image converter. Supports data URI format, one-click decode, preview and download.

Was this result helpful?

For local tools, open DevTools → Network and search your input — it should not appear in requests.

Next steps

Usage Guide

When an API nests a long Base64 blob, HTML embeds a data:image/... URI, or a log only kept the encoded string, you need a real image file back. This tool decodes and previews in your browser: it peels Data URIs, strips whitespace, normalizes URL-safe (-_) with padding restore, sniffs PNG/JPEG/GIF/WebP via magic bytes, and downloads with the matching extension — the image never uploads.

1. Restore an image

Raw Base64 without a data: prefix is no longer forced to image/png: magic bytes win. If sniffing succeeds but the browser still cannot paint, the payload is often truncated mid-file — error copy distinguishes invalid charset, decode failure, not-an-image, and truncated header.

  1. Paste the Base64 string. Raw Base64, full Data URIs, email-wrapped lines, and URL-safe variants all work.
  2. Click decode: input is normalized, format is sniffed from magic bytes, and a preview shows MIME, size, and dimensions.
  3. Download — the file extension follows the detected format (.png / .jpg / .webp), not a hard-coded .png.

2. When decoding fails

Base64 is lossless. A failed decode almost always means "the input is not a complete valid image Base64", not "the tool ruined quality". Quality loss comes from prior JPEG compression, unrelated to this decode. Hints like "Normalized URL-safe / Stripped whitespace / Restored padding" mean a string-layer fix was applied before preview.

  • Invalid characters: quotes, ellipses, or unexpected junk — clean against the specific error.
  • Whitespace and line breaks: email-style wraps every 76 chars; this tool strips whitespace automatically.
  • URL-safe variant: -_ and missing = from JWT/URL transport are translated and re-padded here.
  • Not an image or truncated: decoded bytes lack a valid image header, or the payload is too short — re-copy from upstream.

3. How it pairs with sibling tools

Privacy note: Data URIs can hold screenshots or ID photos. Decoding stays local here, but never paste sensitive Base64 into untrusted sites. The ~33% size bump is encoding overhead; the restored binary matches the original file size.

  • You only need the text payload, not an image: use the Base64 encoder/decoder.
  • You have a file and need to embed it: use Image to Base64 (Data URI / pure / img / CSS / Markdown formats).
  • Decoded file is huge: download first, then compress or resize.
  • Many images at once: prefer a script; this page is for quick single-file checks.

4. Input shapes and auto-fixes

  • Data URIs: the data:image/...;base64, prefix is stripped; MIME is a hint, magic bytes win.
  • Email wraps and whitespace are stripped before decode.
  • URL-safe -_ becomes +/, and missing = is re-padded by length.
  • Hints like normalized / stripped / padded mean string-layer fixes only — pixels are unchanged.

5. Format sniffing and download extensions

After decode, magic bytes identify PNG, JPEG, GIF, WebP, and more; the download extension follows the sniff, not a hard-coded .png. If sniffing succeeds but the browser cannot paint, the payload is often truncated — errors distinguish charset, decode failure, not-an-image, and truncation.

6. Privacy and batch limits

ID photos and chat screenshots often live in Data URIs. Decoding stays local here, but do not paste sensitive strings into untrusted sites. This page is for single-file checks; use scripts for bulk work.

FAQ

PNG, JPEG, GIF, WebP, and other common formats are detected from file-header magic numbers, and the download extension matches the detected format instead of defaulting to .png. Paste, preview, and download with one click.

No. Plain Base64, strings with the data:image/...;base64, prefix, email-folded text wrapped every 76 characters, and URL-safe variants from JWTs or URLs (- and _ in place of + and /, missing =) all work: the tool strips the prefix, removes whitespace and line breaks, and restores the padding automatically.

The error message distinguishes four cases: illegal characters (stray quotes or ellipses), decoding failure, not an image, and suspected truncation. Most failures come from incomplete copies or stray characters; on "suspected truncation", go back to the source and check that you copied the whole string.

No. Base64 is a lossless encoding; any quality issues come from the original JPEG compression and have nothing to do with decoding. The roughly 33% size bump is the encoding overhead — the decoded binary matches the original file exactly.

This page is built for quick single-image verification and download; for batches, prefer a script. To embed local images into JSON or HTML, use the on-site image-to-Base64 tool; if a decoded image is too large, download it first and run it through compression or resizing.

This site decodes everything locally and never uploads, but do not paste the same content into untrusted third-party sites, and mind screen sharing and screen recording.

Related Tools

Related Articles