Strict, explicit Base64 text conversion
Process Chinese, emoji, and multilingual text as UTF-8 bytes. Choose standard Base64 or Base64URL and an explicit padded or unpadded policy; the tool never switches rules based on the input.
Which alphabet should you use?
- Standard Base64 (+/) uses
+and/. Use it for MIME email, HTTP Basic Auth, Data URLs, and APIs or configuration formats that explicitly require regular Base64. - Base64URL (-_) replaces
+and/with-and_, avoiding escaping and special meanings in URL query strings, paths, and filenames. JWT segments normally use this alphabet.
The alphabet choice only changes the symbols used in the Base64 result. It does not change the source text encoding, which is always converted to UTF-8 bytes first.
Which padding policy should you use?
- Pad when needed (=) retains one or two trailing
=characters when the final group contains fewer than three bytes. Use it for standard Base64 interchange and systems that expect complete four-character groups. No=appears when the byte length is divisible by three. - Omit padding removes trailing
=characters. Use it for JWTs, compact tokens, and protocols that explicitly require unpadded Base64URL.
Typical combinations are “Standard Base64 + padded” for general data interchange and “Base64URL + unpadded” for JWTs or URL tokens. Always follow the receiving protocol: Base64URL can be padded, and standard Base64 can also be explicitly unpadded.
Decoding validates the alphabet, length, padding position, and unused trailing bits. Non-canonical input and invalid UTF-8 stop without returning partial or corrupted text.