Free Base64 File Encoder
Convert any file to a Base64 data URL · everything stays in your browser.
Drag & drop a file here
or
Select or drop a file to encode.
How It Works
- Upload your file: Drop any file — image, PDF, font, audio, or binary — onto the drop zone or click to browse.
- Get the Base64 string: The file is read and encoded to Base64 instantly in your browser.
- Copy and use: Copy the Base64 string to embed in HTML, CSS, JSON payloads, data URIs, or any text-based format.
Why Use Base64 File Encoder?
Binary files cannot be embedded directly in text-based formats like HTML, CSS, JSON, or XML. Base64 encoding converts any binary file into a safe ASCII string that can be embedded anywhere text is allowed. This is essential for embedding images directly in HTML (data URIs), including fonts in CSS, sending files in email or JSON APIs without file upload endpoints, and creating self-contained HTML documents.
Features
- Any file type: Encodes images, PDFs, fonts, audio, video, and all binary files.
- Data URI output: Toggle to get a ready-to-use data URI (data:mime/type;base64,...) for direct embedding.
- Decode mode: Paste a Base64 string to decode it back to binary and download the file.
- File size display: Shows original and encoded sizes so you know the overhead.
- Local processing: Files are read and encoded entirely in your browser — nothing is uploaded.
Frequently Asked Questions
How much larger is Base64 compared to the original file?
Base64 encoding increases file size by approximately 33%. A 100 KB image becomes about 133 KB when Base64 encoded. This overhead is the trade-off for being able to embed binary content in text.
Can I use Base64 images in HTML?
Yes. Use a data URI like <img src="data:image/png;base64,[your-base64]">. This embeds the image directly in the HTML with no external HTTP request, though it increases page size.
Is there a file size limit?
The tool has no enforced limit, but very large files (above 10 MB) may be slow to encode and the resulting string will be extremely long. For large files, consider a server-side solution instead.