Base64 Encoder & Decoder
Encode UTF-8 text or any file to Base64, and decode Base64 back to text or a binary download. Standard and URL-safe alphabets are supported. Nothing is uploaded.
Base64 input
Choose text or a file. Text is encoded as UTF-8.
No file selected. Files are read locally and never uploaded.
Encoded Base64
0 bytes in / 0 characters out
Encoded output will appear here.
Enter text to encode.
Encoding details
- UTF-8 text is encoded by bytes, so accented letters, emoji, and non-Latin scripts round-trip correctly.
- Files are read with the browser File API and encoded without being uploaded.
- URL-safe mode replaces
+with-,/with_, and removes trailing padding. - Base64 is not encryption. Anyone can decode it, so never use it to protect passwords or private data.
Private by design: all encoding and decoding happens in your browser.
Base64 to decode
Standard and URL-safe Base64 are detected automatically.
Decoded output
0 bytes
Paste Base64 to decode it as UTF-8 text or download the decoded bytes.
Decoded output will appear here.
If the bytes are not valid UTF-8, the output shows a hex preview and the download button saves the raw binary data. The copy button is disabled for binary output.
What Base64 is used for
Base64 represents binary data using printable ASCII characters. It is commonly used in data URLs, email attachments, JSON payloads, authentication headers, and tokens. Encoding increases the data size by roughly one third, so it is not a compression method. It is also not encryption: Base64 is trivially reversible and provides no secrecy.
Standard and URL-safe Base64
Standard Base64 uses the characters + and /, and usually ends with = padding. URL-safe Base64 uses - and _ so the value can be placed in a URL or filename without escaping, and it often omits padding. This decoder accepts either alphabet, restores missing padding, and rejects values that mix the two alphabets. It also rejects invalid characters and impossible lengths instead of silently ignoring them.
Unicode and binary handling
Text is encoded as UTF-8 before Base64 conversion, which is why emoji and non-Latin characters survive the round trip. When decoding, the tool first tries strict UTF-8. If the bytes are not valid UTF-8, it does not invent replacement characters: it shows a hex preview and lets you download the original binary bytes. This is useful for images, PDFs, archives, and other files that are not meant to be read as text.
Common Base64 mistakes
- Do not remove characters from the middle of a Base64 value to shorten it; decode the value or use a proper token format.
- Do not assume a string is Base64 just because it contains letters and numbers. Validate its length, alphabet, and padding.
- Do not paste secrets into random online services. This tool processes data locally, but always verify the privacy claims of any tool you use.
- Remember that Base64 is not a substitute for encryption, hashing, or access control.