Multi-format client-side encoder/decoder with UTF-8 unicode support, Base64URL web-safe conversion, and local file DataURI parsing.
Base64 is a binary-to-text encoding scheme that converts arbitrary 8-bit binary data into a set of 64 printable ASCII characters (A-Z, a-z, 0-9, +, and /). It is widely used in MIME email attachments, embedded DataURI media assets, and Authorization HTTP headers.
Standard Base64 utilizes the plus (+) and slash (/) characters, which hold special meanings in URL parameters and filename paths. The Base64URL specification (RFC 4648 Section 5) addresses this by replacing:
+ (Plus) → replaced with - (Hyphen)/ (Slash) → replaced with _ (Underscore)= (Padding) → stripped or optionally preserved
JavaScript's native window.btoa() and window.atob() functions operate strictly on Latin-1 (Byte) character sets, throwing an InvalidCharacterError exception when processing multi-byte UTF-8 symbols (such as CJK characters or emojis). This tool utilizes native TextEncoder and TextDecoder API pipelines to handle full 32-bit Unicode mapping without data corruption.