Blog
Technical8 min readApril 20, 2026

Base64 Encoding Explained

Base64 encodes binary data as ASCII using 64 characters (A–Z, a–z, 0–9, +, /) plus = padding. Output grows ~33% but travels safely through text-only channels.

Common use cases

Data URLs for tiny images in HTML/CSS.

HTTP Basic Auth (username:password encoded in Authorization header).

Email MIME attachments.

JWT header and payload (Base64URL variant).

Base64 is not encryption

Anyone can decode Base64. It provides compatibility, not confidentiality — use real encryption (e.g. AES) for secrets.

UTF-8 and Unicode

Text must be UTF-8 bytes before encoding. WaiHub handles UTF-8 correctly for Chinese, emoji, and all Unicode.