Files & Media

Base64 to File Converter

Decode base64 (or a full API response) into a real file, or encode a file to base64.

Base64, data URI, or JSON response
Prefer to call this programmatically? POST JSON to https://smartitools.com/api/base64-decode and get the raw file bytes back with the right Content-Type — stateless, nothing is stored.
curl -X POST https://smartitools.com/api/base64-decode \
  -H "Content-Type: application/json" \
  -d '{"base64":"...","contentType":"application/pdf","filename":"file.pdf"}' \
  -o file.pdf

Need an actual shareable link instead? POST the same body to /api/temp-upload and you'll get back a URL that serves the file directly (GET, no auth) for 24 hours, then it's automatically deleted.

curl -X POST https://smartitools.com/api/temp-upload \
  -H "Content-Type: application/json" \
  -d '{"base64":"...","contentType":"application/pdf","filename":"file.pdf"}'
# → {"url":"https://smartitools.com/api/temp-file?id=...","expiresAt":"..."}

Frequently asked questions

What file types can this decode?

PDF and common image formats (PNG, JPG, GIF) get a live preview automatically. Any other file type still decodes correctly and offers a direct download — the tool detects it from the file's own header bytes if no content type is given.

Can I paste a full API response, not just raw base64?

Yes. Paste JSON containing a fileBase64, base64 or data key (and optionally contentType and filename) and the tool extracts and decodes it automatically — no need to strip the JSON wrapper yourself.

Is my file uploaded anywhere?

The Decode and Encode tabs, and the "Download" button, run entirely in your browser — nothing is uploaded. The decode API does receive whatever you POST to it, since that's a server request by definition, but it doesn't store anything; it decodes and returns the bytes in the same request. The one exception is "Get shareable link", which does briefly store the file server-side — see the next question.

How does the shareable link work, and is it safe to leave running?

Clicking "Get shareable link" uploads the decoded file to SmartiTools, which returns a URL that serves it back to anyone who has the link — no login required, so treat the link like the file itself. It self-deletes: every time that link (or any other temp link) is requested, expired files older than 24 hours are swept and removed automatically, so nothing accumulates on the server.

What is a data URI?

A data URI embeds a file directly in a string, formatted as data:<content-type>;base64,<data> — used to inline images in HTML/CSS without a separate file request. This tool recognizes and strips that prefix automatically.

Is there an API for this?

Yes — POST JSON to https://smartitools.com/api/base64-decode with a base64 (or fileBase64/data) field, plus optional contentType and filename, and it streams back the raw decoded file with the right Content-Type. It's stateless: nothing is saved server-side.