Base64 File Converter
Convert between Base64 strings and files. In Base64→File mode: decode and download. In File→Base64 mode: encode and copy.
Enter a Base64 string and run decode & download.
How to use
About this tool
Converts between Base64 strings and files: decode/download from Base64, encode/copy from file.
How to use
Choose direction, paste Base64 or select a file. Copy or download the result.
Options
Direction: "Base64→File" decodes Base64 and downloads a file. "File→Base64" encodes a selected file and copies the Base64 string.
Use cases
• Embedding images as Data URLs • Small file in JSON • Decoding email attachments • E2E test fixtures
Code Examples
JavaScript
Read Only
1// File → Base64
2const buf = await file.arrayBuffer();
3const b64 = btoa(String.fromCharCode(...new Uint8Array(buf)));
4
5// Node: fs.readFileSync(path, {encoding:'base64'})Python
Read Only
1import base64
2
3with open("file.png", "rb") as f:
4 b64 = base64.b64encode(f.read()).decode()PHP
Read Only
1base64_encode(file_get_contents("file.png"));Privacy and data
Conversion is in-browser; files and Base64 are never sent to a server.
FAQ
- Q: What can I use Base64 file conversion for?
- A: Common uses include embedding images as Data URLs in HTML/CSS, including small files in JSON payloads, decoding Base64-encoded email attachments, and creating test fixtures for end-to-end tests.
- Q: Is there a file size limit?
- A: There is no hard limit enforced by this tool, but very large files may slow down your browser since all processing is done in memory. For most use cases, files under 10MB work well.
- Q: What file types are supported?
- A: Any file type is supported for both encoding and decoding. The tool converts the raw bytes of the file to or from Base64 without any file type restriction.
- Q: Is my file sent to any server?
- A: No. All conversion is done entirely in your browser using the FileReader API. Your file is never uploaded to any server.
