File to Base64 Converter - Free, No Sign-Up
Overview
Embedding a file as a data URI in HTML or CSS, attaching binary data to a JSON payload, or debugging a base64-encoded attachment in an email all require the same first step: convert the file to a Base64 string. Drop any file here and the FileReader API encodes it in-browser. A 1MB file produces about 1.37MB of Base64 text.
How to Use This Tool
Drag a file onto the drop zone or click to select one. The Base64 output appears below once the browser finishes reading the file. Click Copy to grab the string or Download to save it as a .txt file. For data URI use, prepend the appropriate MIME type: data:image/png;base64, followed by the output.
Ready to get started? It's free, no registration required, and your files never leave your device.
PDF Tool →Frequently Asked Questions
Is there a file size limit?
There is no hard limit enforced by the tool. Encoding happens in your browser, so practical limits depend on available memory. Files over 10MB may cause slow processing on lower-end devices.
Can I encode a PDF to Base64 for use in a JSON API?
Yes. Drag the PDF onto the drop zone. The encoded string can be embedded in a JSON field. Recipients decode it back to binary using any Base64 decoder. This pattern is common in document management APIs.
Why is the Base64 output 33% larger than the original file?
Base64 encodes every 3 bytes into 4 ASCII characters, which is a 4/3 ratio. A 100KB file becomes approximately 133KB of Base64. This overhead is the standard trade-off for binary-to-text encoding.