// UTILITY / 002 • DATA_ENCODING

Base64 Text Encoder & Decoder

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.

// PRIVACY_NOTE: Local browser execution. Tool input is strictly processed in-memory and never transmitted to a conversion API or database.
⌘ raw_input.txtUTF-8 / UNICODE

Base64 Input Area

⌘ output.b64

Base64 Output Area

// TEXTDECODER & TEXTENCODER ATOMIC PROCESSING • 0 SERVERS INVOLVED

// WORKFLOW / STEP_BY_STEP

How to Encode & Decode Base64

Follow these steps to convert text, handle Unicode characters safely, and generate URL-safe Base64 strings:

01PHASE_01

Enter or Paste Text / Base64

Type or paste your plaintext message, JSON string, or encoded Base64 payload into the input editor.

02PHASE_02

Toggle URL-Safe Mode

Enable "URL-Safe Base64" if the output will be embedded in HTTP query strings, route paths, or JSON Web Tokens (JWTs).

03PHASE_03

Execute Encode or Decode

Click "Encode to Base64" to serialize your text, or "Decode to Text" to recover the original UTF-8 string.

04PHASE_04

Inspect Character & Size Metrics

Review the output metadata to verify character count and the 33.3% encoding expansion factor.

05PHASE_05

1-Click Clipboard Copy

Click the copy button to copy the encoded or decoded string directly to your system clipboard.

// SPECIFICATION / RFC_4648

Base64 Encoding Specifications & Invariants

Formal specification details and platform behaviors for standard and URL-safe Base64 data serialization:

[SPEC_01]ALGORITHM

8-Bit to 6-Bit Splitting

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.

[SPEC_02]UNICODE

Multi-Byte UTF-8 Handling

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.

[SPEC_03]ROUTING

URL-Safe Mode (RFC 4648 §5)

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.

// SPECIFICATION / TECHNICAL_DEEP_DIVE

RFC 4648 Alphabet & Encoding Mechanics

Technical architecture details, byte alignment rules, and security invariants for Base64 serialization:

01SPEC_MODE

The 33.3% Overhead Factor

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.

3 input bytes (24 bits) -> 4 output ASCII chars (32 bits)
02SPEC_MODE

RFC 4648 §4 vs §5 Alphabet

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.

Standard: "a+b/c==" -> URL-Safe: "a-b_c"
03SPEC_MODE

Encoding vs Encryption Myth

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.

/* WARNING: Base64 provides ZERO cryptographic confidentiality */
! // DIAGNOSTICS / ERROR_REMEDIESRESOLUTIONS

Common Base64 Errors & Solutions

Resolve character encoding exceptions, padding anomalies, and multi-byte decoding issues:

ERR_INVALID_CHARACTERInvalid Base64 character detected

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.

ERR_PADDING_STRUCTUREInvalid Base64 padding structure

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.

ERR_MALFORMED_UTF8Decoding failed: The input contains non-UTF8 bytes

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.

# // BOUNDARIES / PLATFORM_LIMITSINVARIANTS

Platform Limitations & Security Guidelines

Key constraints and security practices when utilizing Base64 encoding in modern web applications:

  • Text Payload Scope: This utility is optimized for text, JSON, configuration strings, and authentication tokens. For multi-megabyte binary files (such as videos or ISO images), use browser Blob / FileReader APIs or command-line tools.
  • Volatile Browser Memory: Transformations execute entirely in client-side RAM; your text is never sent over the wire or stored in persistent browser storage.
  • No Encryption Provided: Base64 offers zero cryptographic protection. If you need data integrity or secrecy, pair Base64 with proper encryption (AES-GCM) or hashing (SHA-256).
// UTILITY_GRAPH / COMPANION_TOOLS
004PROTOCOL

URL Component Encoder

Percent-encode query parameters, URI components, and form values conforming to RFC 3986.

006CRYPTO

Hash Generator

Compute SHA-256, SHA-384, or SHA-512 cryptographic digests to verify file and message integrity.