Base64 Encoder / Decoder
Encode and decode Base64 for text and files. URL-safe mode, auto-detect, and file data URI generation. 100% in-browser.
Encode and decode Base64 for text and files. URL-safe mode, auto-detect, and file data URI generation. 100% in-browser.
Base64 encodes binary data as ASCII text by grouping every 3 bytes into 4 printable characters drawn from a 64-character alphabet (A–Z, a–z, 0–9, +, /). The output is about 33% larger than the input. A = padding character aligns the output length to a multiple of 4.
Standard Base64 uses + and / which have special meanings in URLs (query separators). URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _. Use URL-safe mode for JWT tokens, URL parameters, and filenames. Both variants are supported here with automatic conversion.
A Data URI embeds file content directly into HTML or CSS: data:<mediatype>;base64,<data>. Useful for small images in CSS backgrounds or email HTML where external references are blocked. Avoid for large files (>10 KB) as they increase page weight and can't be cached separately by the browser.
The auto-detect mode checks whether the input looks like valid Base64 (character set, length divisible by 4 with optional padding) and automatically chooses encode or decode. If you see unexpected output, switch to explicit Encode or Decode mode.