Universal File to Base64 Converter
Convert any file (PDF, MP3, WOFF2, ZIP) to Base64 for JSON APIs with auto-detected MIME types
File to Base64
Drop any file or click to browse
PDF, MP3, ZIP, any format
Base64 → File (Decode & Download)
🔒 All processing happens locally in your browser
How to Use Base64
- 1 Upload any file (PDF, audio, font, etc.)
- 2 The tool auto-detects the MIME type
- 3 Copy the Base64 string or Data URI
- 4 Paste into JSON APIs or data stores
- 5 To decode: paste Base64 and download as file
What You Get
Universal file converter with MIME type detection. Perfect for embedding fonts in CSS, PDFs in apps, or sending binary data via JSON APIs.
Input: document.pdf
Output: data:application/pdf;base64,JVBERi0xLj...
Input: font.woff2
Output: data:font/woff2;base64,d09GMgABAA...
How do I convert a file to Base64?
Upload any file (PDF, audio, font, etc.). The tool auto-detects the MIME type and outputs Base64 string and Data URI ready for use.
How do I decode Base64 back to a file?
Paste the Base64 string, click Download File. The tool detects the file type from the data and offers the correct download.
How do I send a file in a JSON API?
Convert to Base64, copy the JSON snippet. Paste into your API request body. Most APIs accept Base64-encoded file data.
What file types can I convert to Base64?
Any file type works. Common uses: PDFs, audio files (MP3, WAV), fonts (WOFF2, TTF), archives (ZIP). MIME type is auto-detected.
How do I embed fonts as Base64 in CSS?
Convert your WOFF2 or TTF file, copy the Data URI, use in @font-face src. This eliminates external font file dependencies.
What is the maximum file size for Base64 conversion?
Limited to 50MB for browser stability. Very large files may slow your browser. Consider compression first for large files.
How do I detect file type from Base64?
The tool examines the decoded data for file signatures (magic bytes). PDFs start with %PDF, PNGs have specific header bytes, etc.
Can I convert Base64 from an API response to downloadable file?
Yes. Paste the Base64 string from your API response, click Download File. The decoded binary file downloads with correct MIME type.
All processing happens in your browser. No data is sent to any server.