Base64 ⇄ File Converter
Encode any file — document, archive, font, or binary — to Base64, or decode Base64 back into a downloadable file. Handles files up to 200MB.
Drag & drop a file here, or click to browse
Any file type, up to 200MB — nothing is uploaded
How to use this tool
File → Base64: drop in any file and copy the text. Files over 5 MB are encoded in the background and downloaded as a text file rather than shown. Base64 → File: paste plain Base64 or a data: URL, type a file name and decode. With a data URL, the extension is added for you if you leave it off.
How big the text gets
Every 3 bytes become 4 characters, so the text is a third larger than the file: this site's 674-byte favicon becomes 900 characters, and a 1.5 MB PDF about 2 MB of text. That matters where text has a size limit. A JSON API request body, an environment variable or a database field often has one, and 33% can push a file that fits as an upload over the limit as text. Compression doesn't win it back either: gzipped, the favicon was 697 bytes and its Base64 text 721.
When decoding fails
- Spaces and line breaks are ignored, so Base64 wrapped into short lines, as in email source and PEM certificate files, decodes fine.
- URL-safe Base64, used in JWTs and some APIs, has
-and_where standard Base64 has+and/. Swap them back before decoding. - A string cut short when copying fails or produces a damaged file. The length of complete Base64 is a multiple of 4, counting any
=padding at the end.
Frequently Asked Questions
Does this work for any file type, or just text/documents?
Any file type — PDFs, fonts, archives, executables, images, anything. Base64 works at the byte level, not the content level, so it doesn't need to understand what kind of file it's encoding. The only thing that matters when decoding back is giving the output the correct file extension so your OS and applications recognize it correctly.
How do I get a data: URL instead of plain Base64?
Put data:, the file's type, ;base64, and a comma in front of the text: data:application/pdf;base64, followed by the Base64 for a PDF, or data:image/png;base64, for a PNG. For images, the Base64 Image Converter builds the full data URL for you.
Is this different from a Base64 text-only encoder?
Yes. A Base64 tool built for text decodes its output as UTF-8 text, and any byte sequence that isn't valid UTF-8 gets replaced, so a real file doesn't survive the round trip. This tool works directly on raw file bytes at every step, so a PDF, ZIP, or font file decodes back byte-for-byte identical to the original, not just visually similar.
Related Tools
Related Blog Posts
How to Convert JSON to Excel, CSV, XML and YAML (and Back)
What actually happens to your data when JSON becomes a spreadsheet, XML, or YAML: missing keys, nested values, leading zeros, and the XML array problem, with real converter output.
Read moreConverting CSV and XML to Excel Without Losing Data
Why double-clicking a CSV mangles PIN codes, long IDs and ₹ signs, what a careful CSV-to-Excel conversion does instead, and how XML records map to spreadsheet columns.
Read moreHow to Flatten Nested JSON and Convert JSONL Files
How dot-notation flattening turns nested objects and arrays into spreadsheet columns, what survives the trip back, and how JSON Lines differs from a normal JSON file.
Read more