File to Base64 Converter
Convert any file - images, PDFs, text and more - into a Base64 (data URI) string and copy or download it with one click. Or paste a Base64 string or data URI to restore and save the original file. Everything runs in your browser - your files are never uploaded.
Drag & drop
or
Any file: image, PDF, text, audio, ZIP and more (max 25MB)
How to Use
Choose a direction
Use "File → Base64" to encode a file into a data URI, or "Base64 → File" to restore a data URI back into a file.
Provide a file or Base64
Drag & drop or select a file to encode. To decode, paste the Base64 or data URI string into the text box.
Copy or save the result
Copy the data URI or Base64 string in one click. Restored files download directly with auto MIME detection.
About the File to Base64 Converter
An online tool that encodes any kind of file - images, PDFs, text, audio, ZIP and more - into a Base64 "data URI" string. A data URI lets you embed a file directly into HTML, CSS or JSON so you can carry data without referencing an external file. You can also paste a received Base64 string or data URI to restore and save the original file. The MIME type is detected automatically from the data signature, or you can set it manually. All processing happens entirely in your browser (JavaScript), so your files are never sent to any server.
Features
- Any file typeNot just images - convert PDFs, text, audio, ZIP and any other file format.
- Two-way conversionEncode files to Base64 and decode Base64 back to files - both in one tool.
- Auto MIME detectionDetects the MIME type from the data URI or file signature, with manual override.
- Browser-only processingEverything runs locally in your browser. Your files are never uploaded to a server.
Use Cases
- Embed a file inside a JSON or YAML config
- Save a PDF or file received as a data URI
- Inline files in HTML emails or web fonts
- Restore Base64 data from an API response into a real file
- Reduce HTTP requests by embedding small files
FAQ
Are my files uploaded to a server?
What kinds of files can I convert?
What is the difference between a data URI and a Base64 string?
Does Base64 change the file size?
Do I need a MIME type to decode Base64 back to a file?
Does it work on smartphones?
Feedback
Missing a feature, or getting a result that looks wrong? Let us know — we improve our tools based on your feedback.