Convert Base64 ↔ files locally
Preview images, download files, and copy Base64 — all in your browser

This tool does two things: it turns an uploaded file into a Base64 string (useful for copy/paste workflows), and it turns a Base64 string back into a downloadable file. If the Base64 contains a data-URI prefix (or looks like a common file signature), the tool can infer the file type.
Privacy note
Conversions happen in your browser. Nothing is uploaded by this page. (Just remember: if you paste Base64 into a third-party site, that’s a separate decision.)
Base64 is an encoding, not encryption. If you need confidentiality, use real encryption (for example, our Encrypt / Decrypt Text), and treat Base64 as a packaging format.
A) Base64 to file (download)
Optional: set a filename and extension
If you leave Extension blank, the tool tries to infer it from the Base64 (data URI or common file signatures).
Paste your Base64 string
You can paste raw Base64 or a full data URI (for example, data:image/png;base64,...) — both are supported.
Preview (images only) and download
Use “Preview image” to sanity-check pictures. Then use “Download file” to save it.
B) File to Base64 (copy/paste)
Upload the file
Drag and drop a file, or click Browse files to select one.
Copy the Base64 result
The output is a data URI (it includes the MIME type prefix). This is convenient for HTML/CSS and quick sharing.
Use it where you need it
Paste into HTML, a config file, a JSON payload, or an email (depending on your workflow).
Quick sanity check: does the size look reasonable?
Base64 increases size by about one third. A handy rule of thumb is:
where is the input size in bytes and is the Base64 length in characters (not counting line breaks).
Example 1: Embedding a small image in HTML
Background: you want a single self-contained HTML file. Upload an image, then copy the data URI into an tag.
Size sanity check
Suppose the image is (10 KB).
Result: the Base64 string will be longer than the original file (that’s expected).
Example 2: Recovering a PDF from Base64
Background: an API response contains a Base64 payload. Paste it into “Base64 to file”. If the Base64 starts with a known PDF signature, the tool can infer the MIME type and suggest an extension.
How to interpret the output
After downloading, you can validate the file type further using our PDF Signature Checker.
Example 3: Debugging an API that returns Base64
Background: you’re not sure whether an API returns a raw Base64 payload or a full data URI. Paste it into the Base64 field. If it includes a prefix like , the tool can use that to decide the file type.
If you only need Base64 text decoding (not files), use our Base64 String Encoder/Decoder.
Inline assets in HTML/CSS
Turn small images into data URIs for a single-file demo page or an email template.
API troubleshooting
Decode Base64 responses into real files so you can open them and inspect the content.
Database payloads
Convert a file to Base64 before storing it in a JSON field (only when you really must).
Email attachments (legacy)
Understand Base64 strings you see in raw emails and MIME parts.
Quick previews
Paste Base64 for an image and preview it before downloading.
File-type guessing
When the extension is unknown, let MIME inference suggest an extension, then verify by opening the file.
When it may not apply: if your data needs to be URL-safe, you likely want Base64URL. Use our Base64 String Encoder/Decoder and enable URL-safe mode.
Practical tips
Common mistakes to avoid
Base64 converts every 3 bytes into 4 printable characters. That’s why Base64 is larger than the original bytes.
= input bytes, = Base64 length (characters)
Why padding exists
If the byte length is not a multiple of 3, Base64 adds padding characters so the output length is a multiple of 4. In many contexts, you’ll see one or two characters at the end.
Data URIs
A data URI embeds the MIME type and the Base64 payload in one string. Conceptually it looks like:.
Base64 vs Base64URL
Base64URL is a URL-safe variant that avoids characters that often need escaping. If you’re dealing with tokens (JWT parts, URL parameters), prefer Base64URL.
Base64 expands data: roughly of the original byte length. Use as a size estimate.
Yes. Strings that start with are supported.
Preview only makes sense for images. If your Base64 is a PDF, ZIP, or other type, downloading is the right path.
No. Base64 is reversible encoding. For encryption, use Encrypt / Decrypt Text.
That’s Base64URL. Decode it with our Base64 String Encoder/Decoder (URL-safe mode), then use the result as needed.
What this tool does not guarantee
Use a simple chronometer (stopwatch) to track elapsed time down to milliseconds. Runs locally in your browser.
Normalize email addresses to a standard format for easier comparison. Useful for deduplication and data cleaning. Runs locally in your browser.
Estimate the time needed to consume a total amount at a constant rate, and get an expected end time. Runs locally in your browser.
Parse and decode your JSON Web Token (JWT) and display its content. All computation runs locally in your browser.
Know which file extensions are associated to a MIME type, and which MIME type is associated to a file extension. Includes a full MIME types table.
Generate random Lorem Ipsum placeholder text with customizable paragraphs, sentences, and word counts. Runs locally in your browser.