How Convert Unicode to Base64 Works
Convert Unicode to Base64 encodes international Unicode text safely through UTF-8 before Base64 serialization, avoiding the classic JavaScript `btoa()` Latin-1 crash on emojis and non-Latin characters.
The Unicode Standard assigns unique scalar code points from U+0000 through U+10FFFF across 17 planes, encompassing over 150,000 characters spanning world scripts, mathematical operators, technical symbols, combining diacritics, and multi-codepoint emoji sequences. Every operation in this utility runs completely client-side inside your browser using native code-point and grapheme-cluster algorithms so surrogate pairs, ZWJ emoji, and combining marks stay intact with zero server latency.
UTF-8 Byte Bridge + RFC 4648 Base64
bytes = new TextEncoder().encode(str) base64 = btoa(bytes_as_binary_string) Base64url: replace "+"->"-", "/"->"_", strip "="
Every 3 UTF-8 bytes (24 bits) encode into 4 Base64 characters (6 bits each), making full Unicode text safe for HTTP headers, JWT payloads, and JSON transport.
Worked Reference Examples
| Input | Output | Technical Note |
|---|---|---|
| Hello, Unicode 🌍! | SGVsbG8sIFVuaWNvZGUg8J+MjSE= | 19 UTF-8B -> 28 chars |
| こんにちは世界 | 44GT44KT44Gr44Gh44Gv5LiW55WM | 21 UTF-8B -> 28 chars |
| Base64url mode | Replaces + / = | Safe for URLs & JWTs |
Practical Developer & Internationalization Workflows
JWT & OAuth Payloads
Generate URL-safe Base64url Unicode JSON claims without padding.
MIME Email & PEM Transport
Wrap Base64 output at 64 or 76 characters per line.
Compatibility, Edge Cases & Best Practices
Base64 is an encoding for transport safety, not encryption — anyone can decode Base64 instantly.
Copy verified outputs directly to your clipboard or export them as UTF-8 text files ready for web apps, REST APIs, database migrations, typography tests, and localization pipelines.