What this tool does
Base64 turns arbitrary bytes into a 64-character ASCII alphabet that travels safely through URLs, JSON, email headers, and anything else that doesn’t love raw binary. This tool encodes UTF-8 text (or files you drop in) to Base64 and decodes Base64 back to text, with full support for the URL-safe variant (RFC 4648 §5). Everything runs in your browser — nothing is uploaded.
How to use it
Pick Encode or Decode, then pick Standard or URL-safe. Paste your input, drop a file, or load the example.
Encode example:
Input: hello world
Output: aGVsbG8gd29ybGQ=Decode example (URL-safe, no padding):
Input: 6L6T5YWl5L2g5aW9
Output: 輸入你好Limits and edge cases
- Decoded bytes must be valid UTF-8 for the text output to make sense. Decoding a PNG or zip will surface a “not valid UTF-8” error — that’s the tool refusing to mojibake your data.
- The standard variant always uses
+,/, and trailing=padding. The URL-safe variant swaps to-and_, and lets you drop the padding. Decode tolerates either alphabet automatically. - Whitespace and line breaks in input are stripped before decode (so MIME-wrapped Base64 from email or PEM keys works as-is).
- Large files (> a few MB) are still processed entirely in the browser; expect to wait a moment for very large inputs.
Frequently asked questions
- Is my data sent to a server?
- No. Both encode and decode happen entirely in your browser; the page never uploads your input.
- What's the difference between standard and URL-safe Base64?
- Standard (RFC 4648 §4) uses + / =. URL-safe (§5) swaps + and / for - and _, so the encoded value can sit in a URL or filename without further escaping. Padding is optional in URL-safe.
- Why do I get 'not valid UTF-8' when decoding?
- The decoded bytes aren't text — they're binary data (e.g. an image, a key, an archive). Base64 itself is fine; it's the underlying bytes that aren't a UTF-8 string. For binary, use the Download button to save the raw decoded bytes instead.
- Does it handle emoji and CJK characters?
- Yes. Input is encoded as UTF-8 before Base64 conversion, so 你好, 👋, and any other non-ASCII characters round-trip cleanly.
- Can I drop a file to encode?
- Yes. Use the Upload button or drag-and-drop a file onto the input panel; the file's bytes are encoded as Base64.
- Why does my Base64 string sometimes end with == or = and sometimes not?
- Standard Base64 pads the output to a multiple of 4 with =. URL-safe Base64 often drops the padding. Decoders should accept both — this one does.