Base64 Encoder & Decoder
Encode and decode Base64 free in your browser — text or a whole file, standard or URL-safe alphabet. Paste text, get the Base64 string instantly, or paste a Base64 string back and read the original, with nothing uploaded anywhere.
Base64 Encoder & Decoder
Encode and decode Base64 in your browser — text and files, standard or URL-safe. Free, private, no signup.
100% private — encoding and decoding run in your browser. Nothing is uploaded or stored. Base64 is encoding, not encryption: anyone can reverse it, so never use it to hide a secret.
How to use the Base64 Encoder & Decoder
- Choose Encode or Decode at the top. Encoding is the default.
- Type or paste your text, or — in Encode mode — choose a file to encode instead.
- Tick URL-safe output if the result must go inside a URL or a filename.
- The result appears instantly below, with input size, output length and the size change shown beside it.
- Click Swap input / output to flip the result into the input and check the round trip in the other direction.
- Copy the result or download it as a text file. Click Clear to reset everything.
What Base64 is and where you meet it
Base64 is a way to represent binary data as plain text. It takes any bytes — text, an image, a file — and rewrites them using only 64 safe ASCII characters: uppercase and lowercase letters, digits, plus and slash, with equals signs as padding. Every 3 bytes of input become 4 characters of output, which is why Base64 text is about a third larger than the original. You meet it more often than you notice: images embedded directly in a web page as data URIs, the username-and-password string in a Basic Auth header, attachments inside an email, and the first two segments of a JWT token are all Base64. It exists because many systems — URLs, headers, JSON, email — were built for text and mishandle raw binary, so encoding the binary as text lets it travel safely through them. Decoding reverses the process exactly, returning the original bytes.
Standard Base64 vs URL-safe Base64
The standard Base64 alphabet contains two characters that cause trouble inside a URL: the plus sign can be read as a space in a query string, and the slash separates path segments, so a Base64 string pasted into a link can break the link or change meaning. The URL-safe variant solves this by swapping plus for a dash and slash for an underscore, and it usually drops the equals padding, since padding can also confuse URL parsers. The two forms carry the same data — only those characters differ — so converting between them is a simple substitution, not a re-encode. This tool’s URL-safe checkbox applies the swap and strips padding when encoding, while the decoder accepts both alphabets with or without padding, so a string copied from anywhere decodes correctly either way. If you must put standard Base64 inside a URL query value and keep its alphabet, percent-encode it instead with a URL encoder.
UTF-8, emoji and why naive encoding breaks
The classic JavaScript shortcut for Base64, btoa, only accepts characters in the Latin-1 range, so it throws an error on emoji, accented letters and most non-English text. The correct path is to convert the text to its UTF-8 bytes first and encode those bytes, which this tool does with the browser’s TextEncoder — so café, Urdu script, Chinese characters and emoji all encode and decode exactly. A useful check: the word café is five characters but nine UTF-8 bytes, and its Base64 reflects the nine bytes, not the five letters. The same rule applies in reverse: decoding produces bytes, and those bytes are read back as UTF-8 text, so a string encoded elsewhere with proper UTF-8 handling round-trips cleanly here. If decoded bytes are not valid UTF-8 text at all — for example when a file was encoded — the tool says so plainly instead of showing garbled characters as if they were the answer.
Base64 is encoding, not encryption
Base64 hides nothing. Anyone who sees a Base64 string can decode it in a second without a key, a password or any secret at all, which is why it must never be used to protect sensitive data. Its job is transport, not secrecy: it makes binary safe to carry through text-only systems. That distinction matters most with tokens — a JWT’s header and payload segments are Base64, so anyone holding the token can read them, and only the signature in the third segment provides any security, which this tool does not check. The same applies to passwords and API keys: encoding one in Base64 and pasting it somewhere public exposes it just as surely as pasting it in plain text. Use Base64 to move data, and use real encryption — or simply do not share the secret — to protect it.
Try more free Web Tools: JSON Formatter & Validator, UUID Generator and Hex to RGB Converter.
Frequently asked questions
No. Base64 is encoding, not encryption — anyone can decode a Base64 string without a key. Never use it to hide a password, token or secret.
Every 3 bytes become 4 characters, so the text form is always roughly a third bigger than the original bytes. That overhead is the price of travelling safely through text-only systems.
It swaps + for – and / for _, and drops the = padding, so the string survives inside URLs and filenames. This tool’s decoder accepts both alphabets, with or without padding.
No. Encoding and decoding run entirely in your browser, so your files never leave your device — even a 25 MB file is processed locally.