Base64 encoder and decoder
Encode text or files to Base64 and decode it back, in standard or URL-safe form. Everything runs in your browser: nothing is uploaded.
Questions
Is my text or file uploaded?
No. Encoding and decoding run in your browser with JavaScript. A file is read from your disk by this page and never uploaded, and nothing you type is sent anywhere or put in the address bar.
What is the difference between Base64 and Base64URL?
Both turn every 3 bytes into 4 characters from a 64-character alphabet (RFC 4648). Standard Base64 uses + and / and pads the end with =. Base64URL uses - and _ instead, so the result is safe in URLs and file names, and usually drops the padding. JWTs use Base64URL without padding.
Is Base64 encryption?
No. It is an encoding: anyone can decode it, without a key. It makes binary data safe to carry as text, in email attachments, data: URIs and JSON. Don’t use it to hide passwords or tokens.
Why is the Base64 a third bigger than the input?
Every 3 bytes become 4 characters, so the result is about 33% larger, plus line breaks if you wrap at 76 characters as email does (MIME, RFC 2045). A 3 MB image becomes about 4 MB of text. Text is encoded as UTF-8 first, so é and € take 2 and 3 bytes.
Why does my Base64 decode to a file instead of text?
Base64 can hold any bytes. When the decoded bytes aren’t valid UTF-8, or contain control characters such as NUL, the page offers them as a download and names the file type it recognises from the first bytes, such as PNG, PDF or ZIP.
What counts as invalid input?
Any character outside A–Z, a–z, 0–9 and + / (or - _ for Base64URL), apart from = padding at the end. Spaces and line breaks are ignored. The error names the first bad character and its position. A text that mixes + / with - _ is refused, because no encoder writes both.
How big a file can I encode?
Up to 100 MB, because the Base64 text is held in the page’s memory. For bigger files use the command line: base64 -i file on macOS, base64 file on Linux or certutil -encode file out.txt on Windows. Long results are shortened on screen, but Copy and Download take all of it.