How to encode and decode Base64
- Choose whether you are working with text or a file.
- For text: type or paste it in and the Base64 appears as you go. Paste Base64 into the right-hand box instead and it decodes back.
- For a file: drop it in to get a Base64 data URI you can paste straight into CSS or HTML.
Questions people ask
Does Base64 encrypt anything?
No, and this is the most important thing to know about it. Base64 is an encoding, not encryption — anyone can decode it in one step, including with this page. It exists to carry binary data safely through systems that only handle text, such as email or a JSON field. Never use it to hide a password or a key.
Why did another tool mangle my accented characters?
Because the browser’s built-in btoa function only accepts characters up to U+00FF, and many tools feed text straight into it. This one encodes through UTF-8 first, so "café", "日本語" and emoji all round-trip exactly.
What is the URL-safe variant for?
Pick URL-safe if the result is going into a web address or a token. Otherwise the standard one is what you want.
Why is my Base64 file bigger than the original?
Base64 represents every 3 bytes as 4 characters, so the output is always about 33% larger, plus a little for line breaks. That overhead is the price of making binary data text-safe. It is why embedding large images as data URIs slows a page down rather than speeding it up.
Is there a size limit on files?
Files up to a few megabytes are fine. Much beyond that and the result is too long to be useful — link to the file instead.
Is my data uploaded?
No. Both directions run on your own device.