πŸ‡―πŸ‡΅ζ—₯本θͺž

Base64 Encoder / Decoder

Encode and decode Base64 with full Unicode and file support.

Runs entirely in your browser β€” no data is sent to any server
Editable

About Base64

Base64 is an encoding scheme that converts binary data into a string of printable ASCII characters using 64 symbols (A–Z, a–z, 0–9, +, /). It represents every 3 bytes of input as 4 characters of output. Base64 is not encryption β€” it is simply a way to represent binary data as text, making it safe to embed in email messages, HTTP headers, URLs, and configuration files.

Unicode and Multibyte Character Support

The standard JavaScript btoa() function cannot handle Unicode characters directly. This tool encodes text to UTF-8 bytes using TextEncoder before applying Base64, so Japanese, Chinese, Korean, emoji, and any other Unicode characters are converted correctly. Decoding uses TextDecoder to interpret the bytes as UTF-8, preventing mojibake (garbled characters) in all languages.

URL-safe Base64 (RFC 4648 Β§5)

Standard Base64 uses the characters '+' and '/' which have special meaning in URLs and query strings. URL-safe Base64 replaces '+' with '-' and '/' with '_', and removes the '=' padding character. This variant is widely used in JWTs (JSON Web Tokens), OAuth tokens, and any context where the encoded string must appear in a URL without percent-encoding.

Common Use Cases

Decode and inspect JWT headers and payloads (the header and payload sections of a JWT are Base64url-encoded JSON), verify Base64-encoded image data in API responses, embed images inline in HTML or CSS as data URIs to avoid extra HTTP requests, inspect credentials or secrets stored as Base64 in Kubernetes Secrets or Docker configs, and check email attachment data encoded as MIME Base64. Base64 encoding increases data size by approximately 33% (3 bytes β†’ 4 characters), so use it when text safety is required rather than as a compression mechanism. It is a fundamental encoding format for both web development and infrastructure work. When debugging SAML assertions or OAuth flows, Base64-decoding the token immediately reveals the raw XML or JSON payload inside.