Convert any file to Base64
Encode a PDF, ZIP, font, certificate or audio file to Base64 or a data URI locally — no upload, no size cap, no queue.
- Runs in your browser
- Nothing you enter is sent
- Free, no account
Why anything gets Base64-encoded
Plenty of systems can only carry text. JSON has no binary type. Email bodies are text. YAML
manifests, environment variables, database TEXT columns, XML payloads and log
lines are all text. Base64 is the standard way to push arbitrary bytes through those channels
without anything in the middle mistaking a byte for a delimiter or a control character.
What people actually encode here
| File | Where the Base64 goes |
|---|---|
| TLS certificate or private key | A Kubernetes Secret, which requires Base64 for every value |
| Service-account JSON | A CI environment variable, so a multi-line file survives as one string |
| PDF invoice | A JSON API field on a billing or e-signature endpoint |
| WOFF2 font subset | An inline @font-face in a single-file HTML report |
| Small ZIP or firmware blob | An embedded-device payload sent over a text protocol |
| Short audio clip | An <audio src> data URI in a self-contained page |
Kubernetes secrets, specifically
Every value under data: in a Secret manifest must be Base64. This trips people up
twice: first because echo "value" | base64 silently includes the trailing
newline, and second because Base64 in a Secret is encoding, not encryption — anyone
with read access to the object can decode it instantly. Use stringData: if you
would rather let the API server do the encoding, and use a real secret manager for the
confidentiality part.
Size, and when to stop
Encoding here runs in 3 MB slices with a progress bar, so there is no hard limit beyond your device memory. The practical limits are downstream:
- Most JSON APIs reject bodies over a few megabytes.
- Kubernetes caps a Secret at 1 MiB of encoded data.
- Browsers historically limited
data:URIs in the address bar to about 2 MB. - Editors and diff tools become unusable well before any of the above.
Remember that the 33% expansion applies before any of those limits, so a 1 MB file is already 1.37 MB of text.
The trailing-newline trap
Almost every “my Base64 does not match the documentation” report comes down to one
byte. echo adds a newline; printf and echo -n do not.
Encoding a file — which is what this page does — never adds one, so if the value here
differs from your shell output by four characters at the end, that is why.
Encoding a private key on a web page
Reasonably asked. The answer is architectural rather than a promise: this page runs entirely in
your browser, and the site's Content-Security-Policy lists no third-party origin in
connect-src, so the browser itself would refuse an upload even if the code
attempted one. Disconnect from the network and the tool keeps working. That is a materially
different guarantee from an upload-based converter's privacy policy — and in 2025 the PDF
service pdf.net demonstrated why, leaving roughly 3.5 million user documents publicly
reachable.
Questions
Is there a file size limit?
Only your device memory. Encoding runs in 3 MB slices with a progress bar. As a practical guide, anything past a few hundred megabytes produces a string most editors and APIs will refuse to handle anyway.
Is it safe to encode a private key or a certificate here?
Yes, in the sense that matters: the bytes never leave the tab, and the page cannot reach a server because our Content-Security-Policy declares no external origin. It is the same trust model as running base64 in your own terminal.
Which MIME type is used in the data URI?
The type the browser reports for the file, falling back to a table of common extensions, and finally to application/octet-stream. You can always edit the prefix afterwards.
Why is the output about a third larger than the file?
Base64 represents 3 bytes with 4 printable characters, which is a 4/3 ratio by design. It is the price of moving binary data through a text-only channel like JSON, email or a URL.