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.
