Enter or Paste Text / Base64
Type or paste your plaintext message, JSON string, or encoded Base64 payload into the input editor.
Convert text payloads to and from Base64 with full UTF-8 Unicode support, emoji preservation, and RFC 4648 URL-safe mode. Runs 100% inside your local browser memory.
// TEXTDECODER & TEXTENCODER ATOMIC PROCESSING • 0 SERVERS INVOLVED
Follow these steps to convert text, handle Unicode characters safely, and generate URL-safe Base64 strings:
Type or paste your plaintext message, JSON string, or encoded Base64 payload into the input editor.
Enable "URL-Safe Base64" if the output will be embedded in HTTP query strings, route paths, or JSON Web Tokens (JWTs).
Click "Encode to Base64" to serialize your text, or "Decode to Text" to recover the original UTF-8 string.
Review the output metadata to verify character count and the 33.3% encoding expansion factor.
Click the copy button to copy the encoded or decoded string directly to your system clipboard.
Formal specification details and platform behaviors for standard and URL-safe Base64 data serialization:
Base64 maps binary byte streams into 6-bit increments, referencing 64 ASCII characters (A-Z, a-z, 0-9, +, /). Trailing padding (=) ensures 4-byte block alignment.
Native browser btoa() throws an exception on characters outside Latin-1 (>0xFF). DevTools Hub pre-processes text via TextEncoder, converting Unicode and emojis into raw UTF-8 octets before encoding.
Standard Base64 contains + and /, which can be corrupted in URL query strings or URI path segments. URL-safe substitution swaps these with - and _, omitting padding.
Technical architecture details, byte alignment rules, and security invariants for Base64 serialization:
Base64 groups binary data into 3-byte blocks (24 bits) and splits them into four 6-bit units. Each 6-bit unit maps to an ASCII character. This guarantees safe transport over 7-bit ASCII channels at the cost of a 33.3% data expansion.
Standard Base64 (§4) uses "+", "/", and "=" for padding. In URL query strings, "+" represents a space and "/" denotes path hierarchy. URL-safe Base64 (§5) replaces "+" with "-" and "/" with "_", while omitting trailing padding.
Base64 is a serialization format, NOT a security mechanism or encryption algorithm. Anyone can instantly decode Base64 strings. Never store API credentials, passwords, or sensitive keys in Base64 assuming they are protected.
Resolve character encoding exceptions, padding anomalies, and multi-byte decoding issues:
Root Cause: The string to be decoded contains characters outside the standard Base64 alphabet (A-Z, a-z, 0-9, +, /, =, -, _), such as unescaped spaces, tabs, or non-ASCII glyphs.
Solution: Strip leading and trailing whitespace, or verify that the input was not corrupted by word-wrapping or email formatting.
Root Cause: The padding character "=" appears in the middle of the string or more than two "=" characters appear consecutively.
Solution: Ensure padding characters only appear at the very end of the Base64 payload, or strip padding when using URL-safe decoding.
Root Cause: The Base64 payload was successfully decoded into binary octets, but those bytes do not form valid UTF-8 sequences (for example, raw binary images or truncated multi-byte code points).
Solution: Verify that the source payload was originally encoded from a valid UTF-8 text string rather than arbitrary binary data.
Key constraints and security practices when utilizing Base64 encoding in modern web applications:
Percent-encode query parameters, URI components, and form values conforming to RFC 3986.
Compute SHA-256, SHA-384, or SHA-512 cryptographic digests to verify file and message integrity.