toolgarden.xyz
中文

Base64 to image

Free online tool to restore Base64 or data:image Data URLs into image files locally in your browser, with preview and download

Base64 to image

Drop a .txt / .base64 text file here, or press Ctrl + V to paste Base64 directly.

All conversion runs locally in your browser. Images and Base64 content are not uploaded.

Image result

Waiting for Base64

Paste image Base64 or a Data URL to restore the image locally and download it.

About this tool

Base64 to image decodes text and treats the resulting bytes as an image for preview and download. Input may be raw Base64 or a data URL beginning with `data:image/...;base64,`; an accurate MIME type helps the browser select a decoder and file extension.

Successful decoding only means the bytes form a browser-readable image. It does not prove safety, origin, or a correct extension. For long values copied from APIs or logs, remove accidental quotes and whitespace and check for URL encoding or a second Base64 layer.

How to use it

  1. Paste the encoded value

    Keep the complete data URL or provide only the raw Base64 characters.

  2. Decode and preview

    Check the detected format, dimensions, and image; if it fails, inspect the prefix and padding.

  3. Download and verify

    Save with an extension matching the format and open it in the destination software.

Supported range and limits

Accepted input
A bare Base64 string, or a full Data URL with the data:image/...;base64, prefix
Tolerance
Line breaks and stray whitespace are ignored, so multi-line strings copied out of code or logs paste in directly
Format detection
The real type is read from the decoded file header rather than trusting the MIME type in the Data URL
Common failures
A truncated string, missing = padding at the end, or content that is simply not image data
Output
A previewable image you can download in its original format
Where it runs
Decoding happens in the browser; the string is never uploaded

When you would use it

  • Restoring an API image

    Recover an avatar, verification-code sample, or attachment field from an API response.

  • Checking a data URL

    Verify that an inline image stored in CSS, HTML, or a database is complete.

  • Inspecting image data returned by an API

    Some endpoints return captchas or thumbnails as Base64, and debugging means decoding one to see what actually came back.

What to know before you start

  • Do not forward an untrusted decoded result as a safe file; normal upload scanning and validation still apply.
  • Base64 without `=` padding may still decode, but padding cannot repair a truncated payload.
  • Text containing sequences such as `%2F` or `%2B` may need URL decoding first.

Related concepts

padding
The trailing `=` characters used to complete Base64 encoding groups.
MIME type
A media-format identifier such as `image/png` or `image/jpeg`.

Frequently asked questions

Does Base64 to image upload my content?
No. Base64 decoding, preview, and download all happen locally in your browser.
Which Base64 inputs are supported?
Full data:image Data URLs are supported, as well as raw image Base64. Raw Base64 is detected from the image file signature.
Can I drag in a Base64 file?
Yes. You can drag in a .txt or .base64 text file, or press Ctrl + V to paste Base64 content directly.
How is the output image format chosen?
When the input includes a MIME type, it is used first. Raw Base64 is detected from PNG, JPG, WebP, GIF, BMP, SVG, AVIF, and similar signatures.
Why did decoding fail?
Most often the string was truncated when copied out of a log or console. Next most common is missing = padding at the end, or mixing the standard alphabet with the URL-safe one where - and _ replace + and /.
Do I need to join multi-line Base64 into one line first?
No. Line breaks and stray whitespace are ignored, so a multi-line string copied from code or an email source pastes in directly.