Encode to Base64
Text, an image, or any file — turned into Base64, correctly. Accented characters and emoji survive, which the usual one-line implementations do not manage. Nothing is uploaded.
- Processed on your device
- No upload, no waiting
- No signup, no watermark
Text is encoded as UTF-8, so accents and emoji survive.
How it works
Paste text or drop a file
Text is encoded as UTF-8. A file is encoded byte for byte, and never leaves your device.
Choose the flavour
Standard Base64, URL-safe Base64URL for tokens and query strings, or a full data URI ready to paste into CSS or an <img> tag.
Copy it
Copy the result, or download it as a text file if it is large.
Frequently asked questions
Is my text or file uploaded?
No. Nothing is uploaded, nothing is logged, and no request leaves your device — the work happens inside this page, in JavaScript, and it keeps working with the network disconnected. For these tools in particular that is not a nicety. What people paste into online encoders and decoders is routinely live: session tokens, API keys, Authorization headers, customer records. Pasting one of those into a page that sends it somewhere is a disclosure, whatever the site promises about deletion.
Why do accented characters and emoji work here?
Because the text is converted to UTF-8 bytes before being encoded, which is the correct order and what most quick implementations skip. The browser's own `btoa` cannot take text at all — it takes one byte per character, so `btoa("café")` simply throws an error. The widespread workaround, `btoa(unescape(encodeURIComponent(s)))`, works by accident and falls apart on emoji and other characters outside the basic range. This page encodes UTF-8 properly, once, so 日本語 and 🎉 come through and decode back identically.
What is Base64URL and when do I need it?
It is Base64 with two characters swapped: + becomes -, / becomes _, and the trailing = padding is dropped. It exists because +, / and = all mean something in a URL, so ordinary Base64 gets mangled when it travels in a query string or a path. JWTs, OAuth tokens and anything in a URL use Base64URL. If you are putting the result in a link, pick it.
Does Base64 encrypt or protect anything?
No, and this is worth being blunt about. Base64 is an encoding, not encryption — there is no key and no secret. Anyone who sees the string can decode it in one step, including on this site. It exists to carry binary data safely through channels that only accept text, such as email attachments and data URIs. If something needs to be kept secret, it needs encryption; Base64 gives no protection whatsoever.
Why is the Base64 bigger than my file?
About 33% bigger, always. Base64 represents every 3 bytes as 4 text characters, so the size grows by a third by design, plus a little padding. That is the price of turning binary into text, and it is why embedding a large image as a data URI in your CSS is usually a bad trade.
Can I encode an image as a data URI?
Yes — drop the image in and choose data URI. You get the complete `data:image/png;base64,…` string with the right media type already filled in, ready to paste into a stylesheet, an <img> tag or an email template.
Is there a size limit?
Your device's memory rather than an upload cap, and it is generous — files of many megabytes encode fine. Encoding is done in chunks specifically to handle large files; the obvious implementation crashes at around 125 KB with "Maximum call stack size exceeded", which is a bug in a great many online encoders.