File to Base64 Converter
Turn any file into Base64 text: documents, spreadsheets, audio, fonts, archives and more. Choose plain Base64 for web services and databases or a data URI for web pages and code, then copy it or save it as a text file.
or choose a source below
How to Convert a File to Base64
Quick answer: drop your file in, choose Base64 only or Data URI, then copy the text or download it.
-
1
Add your file
Any type, up to 50 MB.
-
2
Pick the output
Base64 only or data URI.
-
3
Wrap if needed
76-character lines for email.
-
4
Copy or download
The full text, in one click.
What You Get
Why Encode a File as Base64?
Many systems can only carry text: web service requests, JSON and XML files, configuration values, database text fields and some messaging formats. Base64 turns any file into letters, numbers and a few symbols so it can travel through those systems safely, and be turned back into the exact same file at the other end.
Base64 or Data URI?
Base64 only is the raw encoded text, which is what most web services and databases want in a "base64" field. Data URI adds a prefix such as data:application/pdf;base64, so browsers and code know what kind of file it is; use it to embed files directly in web pages, style sheets and emails. The file type is detected from the file you add.
Size and Large Files
Base64 is about one third larger than the original file, so a 3 MB document becomes about 4 MB of text. The summary on the left shows the exact size and increase. For files over a few hundred kilobytes, the box shows the beginning of the text to keep the page fast, while Copy and Download always give you the full result.
Example
A web service asks for a signed contract as a Base64 field in a JSON request. Drop the PDF in, keep Base64 only, and press Copy to Clipboard. Paste the text into your request. To check it, paste it into Base64 to File, which rebuilds and previews the document.
Who Encodes Files as Base64?
Developers testing web services and building sample requests, integration teams sending documents between systems, low-code builders storing small files in text fields, web designers embedding fonts and icons, and support teams reproducing problems with attachments.
Tips
For images, Image to Base64 adds ready-made HTML and CSS snippets and can shrink the picture first. For PDFs specifically, PDF to Base64 shows the document's details. For plain text, use Text to Base64.
Good to Know
Base64 is an encoding, not encryption: anyone can decode it, so do not treat it as a way to protect files. Line wrapping is only needed for email and some older systems; leave it off for JSON and web services. The encoding is exact, so the decoded file is identical to the original, byte for byte.
Everyday Scenarios
A developer needs a sample request for a web service that accepts attachments as Base64; drop a test PDF in and copy the result into the request. A designer embeds a small web font in a style sheet as a data URI so the page needs no extra file. An integration team sends a signed document between two systems that only exchange JSON. A support engineer reproduces a customer's problem by encoding the exact file they sent and comparing the Base64 with what the system stored. Each time, the encoding happens instantly and nothing leaves the computer.
Once copied, the Base64 can be pasted anywhere text is accepted, from code editors to forms and spreadsheets.
Private, Free and Unlimited
The file is encoded entirely on your device. There is no sign-up, no watermark and no daily limit. Files are processed by your own browser and never leave your device, which makes the tool safe for contracts, photos, ID scans, client work and anything confidential. Close the tab and everything is cleared from memory. It works in current versions of the major browsers on Windows, Mac, Linux and Chromebooks, and on iPhone and Android for smaller files.
Encoding Any File as Base64
Base64 turns the bytes of any file into text. It is used to attach files inside JSON, to embed images, and to pass binary data through systems that accept only text.
Remember
The text is about a third bigger than the file, and it is not encrypted. Keep an eye on request size limits. The first characters indicate the type: JVBER for PDF, iVBOR for PNG and /9j/ for JPG.
To decode, use Base64 to file.
Frequently Asked Questions
Questions about file to Base64