Base64 to File Decoder

Paste Base64 or a data: URI and download the original file. Detects the file type (PNG, JPEG, PDF, ZIP, JSON…) from magic bytes and previews images.

Runs entirely in your browser. Your data is never uploaded.

What is Base64 File Decode?

Decodes Base64 or a data: URI back to binary and lets you download it as a file. The file type is taken from the data URI, or detected from the content’s magic bytes, so you get the right extension; images are previewed and text files are shown.

How to use Base64 File Decode

  1. Paste the Base64 text or data:…;base64,… URI into Base64 or data URI.
  2. Check the detected File type and Decoded size.
  3. Adjust the File name if you like (the extension is suggested automatically).
  4. Click Download file.

Example

Input
SGVsbG8sIFdvcmxkIQ==
Output
text/plain · 13 B · decoded.txt containing "Hello, World!"

When to use Base64 File Decode

Use it to recover attachments or images from API responses, logs, emails or database fields. If the Base64 contains plain text, the Base64 Decode tool is quicker.

How Base64 File Decode works

Whitespace and the data-URI prefix are removed and the Base64 (standard or URL-safe) is decoded to bytes. The MIME type comes from the data URI if present; otherwise the first bytes are compared with known signatures – for example 89 50 4E 47 for PNG, %PDF- for PDF, PK for ZIP – and valid UTF-8 without control characters is treated as text (JSON, SVG, HTML or plain text). A Blob is created locally for the download.

Common Use Cases

  • Saving an image returned as Base64 by an API
  • Recovering a PDF stored in a JSON field
  • Checking what file type an unknown Base64 blob contains
  • Extracting an embedded font or icon from a CSS data URI

Security Note

Decoded files can be executables or documents with macros. Only open files from sources you trust.

FAQs

How does it know the file type?

From the data: URI if you paste one; otherwise from magic numbers at the start of the data. Formats without a signature fall back to text/plain (if valid UTF-8) or application/octet-stream.

Can I paste URL-safe Base64?

Yes, - and _ are accepted and padding is optional.

Is the file uploaded anywhere?

No, decoding and the download link are created in your browser.

Explore more categories