ASG ToolsPowered by ASG Groups
Developer Utilities

UTF-8 Base64 Text Encoder & Decoder

The problem: JavaScript's native btoa() throws errors when encoding multi-byte Unicode characters, emojis, or international alphabets.

ASG Privacy VerifiedVerified

100% In-Browser Execution. Zero server uploads. Your data never leaves this tab — disconnect your internet and the tool keeps working.

UTF-8 Base64 Text Encoder & Decoder: the complete guide

The UTF-8 Base64 Text Encoder and Decoder converts plain text to standard RFC 4648 Base64 and translates Base64-encoded strings back to clean UTF-8 text with URL-safe variant toggling. Handle foreign language characters, emojis, authentication basic auth headers, and web payloads safely without Unicode character corruption.

How Base64 Encoding Bridges Binary and Text Protocols

Base64 encoding is an algorithmic technique that converts arbitrary binary data or text into an ASCII-safe string format using a 64-character alphabet (A–Z, a–z, 0–9, +, /). Originally designed for sending email attachments over 7-bit ASCII MIME protocols, Base64 ensures data survives transmission across legacy network protocols without byte alteration.

Every three bytes (24 bits) of input data are split into four 6-bit chunks, each mapped to a character in the Base64 alphabet. When input byte counts are not divisible by three, '=' padding characters are appended to complete the 4-character alignment.

Solving JavaScript's btoa() Unicode UTF-8 Bug

A notorious limitation of JavaScript's native window.btoa() function is that it throws an exception when attempting to encode characters outside the Latin1 range (such as emojis or accented characters like 'é', 'ü', 'ñ', or CJK characters).

Our encoder implements modern TextEncoder and TextDecoder APIs, correctly converting multi-byte UTF-8 character sequences into Uint8Array byte streams before Base64 encoding. This guarantees 100% fidelity for international text, symbols, and emojis.

Step by step: how to use Base64 Text

  1. 1

    Select your operation: Encode (Text to Base64) or Decode (Base64 to Text).

  2. 2

    Type or paste your text into the input panel.

  3. 3

    Toggle 'URL-Safe Variant' (- and _ instead of + and /) if embedding within web URLs.

  4. 4

    Review the live encoded/decoded result in the output panel.

  5. 5

    Click 'Copy Result' to copy the text to your clipboard.

Security & privacy

All encoding, decoding, and UTF-8 byte conversions execute locally within browser memory.

Frequently asked questions