Embed this tool on your site
<iframe src="https://devtoolbox.dedyn.io/tools/base64-file-encoder" width="100%" height="800" frameborder="0" title="Base64 File Encoder & Decoder"></iframe>

Base64 File Encoder & Decoder

Encode any file to Base64 text or decode Base64 back to a downloadable file. Supports all file types — PDFs, images, archives, documents, audio, video, and more. Everything runs locally in your browser.

 
📄
Drop any file here or click to browse
All file types supported — Max 100 MB
PDF ZIP PNG MP3 DOCX JSON *.*
Reading file...

File Information

File Name
--
MIME Type
--
Original Size
--
Base64 Size
--
Original
--
--
overhead
Base64
--
Decoding...

Decoded File Information

Detected MIME Type
--
Base64 Length
--
Decoded File Size
--
Suggested Extension
--

Base64 File Encoding Explained

Base64 encoding converts binary file data into a text string using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). This makes it possible to embed files directly into JSON, XML, HTML, CSS, email bodies (MIME), or any text-based format where binary data cannot appear.

Data URIs: The data URI scheme data:[mime];base64,[data] lets you embed files inline in HTML or CSS. For example, embedding a PDF or an image directly into a web page without making an additional HTTP request.

Size overhead: Base64 increases data size by approximately 33% because every 3 bytes of binary data become 4 Base64 characters. For API payloads and data transfer, consider this trade-off between convenience and bandwidth usage.

Frequently Asked Questions

What file types can I encode to Base64?
You can encode any file type to Base64 including PDFs, documents, images, audio, video, archives (ZIP, TAR), executables, and any other binary or text file. Base64 encoding works on raw bytes, so the file format does not matter. The tool auto-detects the MIME type and provides a proper data URI.
How much larger is a Base64-encoded file compared to the original?
Base64 encoding increases the file size by approximately 33%. This is because every 3 bytes of binary data are represented as 4 ASCII characters. For example, a 1 MB file becomes roughly 1.33 MB when Base64-encoded. The tool shows a real-time size comparison so you can see the exact overhead.
Can I decode a Base64 string back to the original file?
Yes. Paste the Base64 string into the Decode tab and click "Decode & Download". If the string includes a data URI prefix (data:mime/type;base64,...), the tool auto-detects the file type and suggests an appropriate filename. You can also specify the filename manually before downloading.
Keyboard Shortcuts
Ctrl+Enter Encode / Decode
Ctrl+Shift+C Copy output
Ctrl+L Clear