Skip to content
Free Tool Arena

File & Format Converters · Free tool

Base64 to Image

Paste a Base64 string or data URL and preview it as an image. Download the decoded PNG or JPG instantly.

Updated June 2026
Found this useful?EmailBuy Me a Coffee

Advertisement

What it does

Paste any base64-encoded image string — with or without the data:image/...;base64, prefix — and the tool decodes it, shows you a live preview of what the image actually contains, and lets you download it as a file. The reverse of the image-to-base64 tool: useful when you've got a base64 blob from an API response, an email attachment header, a CSS file, an HTML data URL, or a JSON payload, and you need the actual image to inspect, edit, or save.

The decoder accepts every common form of input:

  • Full data URL: data:image/png;base64,iVBORw0KGgo…
  • Bare base64 (no prefix): iVBORw0KGgo…
  • Multi-line base64 (with newlines, common in MIME-encoded email): handled transparently
  • URL-safe base64 (- and _ instead of + and /): auto-converted

MIME type is auto-detected from the magic bytes of the decoded data — so even if your input lacks the data-URL prefix, the tool figures out whether it's PNG, JPEG, GIF, WebP, BMP, SVG, or PDF and offers the right download extension. Works entirely in your browser; no upload, no server.

Embed this tool on your siteShow snippet

Paste this snippet into any page. Loads on-demand (lazy), no tracking scripts, and sized to most dashboards. Replace the height to fit your layout.

<iframe src="https://freetoolarena.com/embed/base64-to-image" width="100%" height="720" frameborder="0" loading="lazy" title="Base64 to Image" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px;"></iframe>
Embed docs →

How to use it

  1. Paste your base64 string into the input box. Any common form works — full data URL, bare base64, multi-line, URL-safe.
  2. The image preview renders immediately if the data is valid. The detected MIME type appears below the preview.
  3. Click Download. The file downloads with the correct extension matching the detected format (.png, .jpg, .gif, etc.).
  4. If the preview is blank, the input isn't valid base64 image data — check for stray quotes, backslashes, or HTML escapes that might be corrupting the string.
  5. For huge base64 (>1 MB encoded), the preview may take a second to render — the browser is decoding several megabytes of data.

When to use this tool

  • Inspecting an image embedded in an API response or webhook payload.
  • Extracting an image from an email's MIME-encoded attachment when you only have the raw text.
  • Decoding a data URL you've copied from a CSS file or inline HTML.
  • Verifying that a base64 blob actually contains the image you expected — quick visual sanity check.

When not to use it

  • Non-image base64 (PDF, audio, ZIP) — the preview shows blank for those because the canvas can't render them. Use a generic base64-decoder for arbitrary file types.
  • Encrypted or scrambled data that just happens to be base64-encoded — decoding base64 is not decryption. You need the encryption key, which is a separate step.
  • Base64 that's been further encoded (e.g. URL-percent-encoded) — strip outer encoding layers first.

Common use cases

  • Educational use &mdash; demonstrating the underlying concept
  • Onboarding a colleague who needs the same calculation/conversion
  • Verifying a number or output before passing it on
  • Quick conversion during a typical workday

Frequently asked questions

What's the difference between base64 and data URL?
Base64 is the encoding (binary → ASCII text). A data URL is a complete URL using base64 as its data scheme: `data:image/png;base64,<base64>`. The prefix tells browsers what to do with the bytes; the bare base64 is just the encoded payload. The tool accepts both forms and adds/strips the prefix as needed.
What's URL-safe base64?
Standard base64 uses `+` and `/` characters, which are unsafe in URLs (they have special meanings) and in filenames. URL-safe base64 substitutes `-` for `+` and `_` for `/`. Some APIs use URL-safe by default. The tool auto-detects and converts.
Can I decode multi-line base64 from emails?
Yes. MIME-encoded email attachments wrap base64 at 76 characters per line. The tool strips the line breaks transparently — paste the whole multi-line block and it decodes fine.
How does it know what format the image is?
By inspecting the first few bytes of the decoded data — every image format has a unique 'magic number' at byte 0. PNG starts with 0x89 0x50 0x4E 0x47, JPEG with 0xFF 0xD8 0xFF, GIF with 0x47 0x49 0x46 0x38, etc. The tool reads those and labels the format accordingly.
What's the max base64 size I can paste?
Limited by your browser's clipboard and memory — practical limit is a few megabytes of encoded data (~3-4 MB image after decoding). Paste larger and the browser may freeze for a few seconds during decode.
Is the data uploaded anywhere?
No. Decoding happens in your browser via atob() and an Image element. Open DevTools → Network during use and you'll see zero outbound requests. The image stays on your device.

Advertisement

Learn more

Explore more file & format converters tools

100% in-browserNo downloadsNo sign-upMalware-freeHow we keep this safe →

Found this useful?

The tools stay free thanks to readers who chip in or spread the word.

Buy Me a Coffee