Base64 Encode/Decode

Encode/decode Base64 for binary data transfer

Usage Instructions

🚀 Quick Start

  • Enter text (plain or a Base64 string) into the field
  • Click “Encode” or “Decode” to process
  • Input and result share the same field; copy or clear with one click
  • To verify, encode then switch to “Decode” for a round‑trip check

📌 Common Scenarios

  • URL/JWT: Prefer the URL‑safe variant (−/_); the trailing '=' may be omitted to avoid escaping issues
  • Email/MIME: When wrapping is required, use MIME 76 columns (CRLF); for the web, don't wrap. This tool provides 76‑column wrapping and an LF/CRLF toggle
  • Multiline text: enable Per‑line encode to encode each line independently
  • MIME/PEM: enable 76‑column wrapping; enable LF line breaks when needed
  • Data URL: When embedding, generate data:[mime];base64,…; the decoder auto‑extracts the part after the comma
  • Round‑trip verify: encode then immediately decode to ensure fidelity

🎛️ Encoding Parameters & Variants

  • URL‑safe output
  • Encode per line (each line independently)
  • Wrap at MIME 76 columns (CRLF)
  • Use LF for line breaks (\n)
  • Auto‑padding: length aligned to a multiple of 4; invalid lengths are reported
  • Whitespace‑tolerant: line breaks and spaces are removed on decode

🧭 Usage Advice

  • Use UTF‑8 consistently to avoid garbled characters
  • Default is URL‑safe; disable it for standard Base64
  • When exchanging across systems, strip line breaks/spaces; add only for display
  • Base64 increases size by ~33%; avoid for large files
  • Standard Base64 for legacy systems: disable URL‑safe (keep +/ and =)
  • Per‑line encode re‑encodes existing Base64; for variant conversion only, turn it off before encoding
  • 76‑column wrapping affects display only; the decoder ignores breaks and whitespace

⚠️ Limitations & Compatibility

  • Very long text may affect performance; consider splitting
  • Binary data: the UI is text‑centric; for binaries use Data URLs or CLI tools
  • Max size is limited by browser memory

🔒 Privacy & Security

  • All processing happens in your browser; data never leaves your device
  • Security note: Base64 is encoding, not encryption. Encrypt sensitive data first, then encode

❓ FAQ

What is Base64? Why “encode”?

Base64 is a scheme to safely represent arbitrary binary data as printable text characters. It first appeared in email's MIME standard (1990s, RFC 1521/2045) and was later unified by RFC 4648. The goal is not “encryption” but reliable carriage of bytes over text‑oriented channels. How it works: every 3 bytes (24 bits) are split into four 6‑bit blocks and mapped to 64 characters A–Z, a–z, 0–9, +, /. If the source length is not a multiple of 3, “=” padding aligns the length. Size typically grows by ~33%. Variants & choices: RFC 4648 defines the URL‑safe variant, using “-” and “_” instead of “+” and “/”, and the trailing “=” may be omitted. Prefer URL‑safe for URLs, Cookies and JWT; use standard Base64 (keep +/ and =) for legacy/MIME toolchains. This tool defaults to URL‑safe; the decoder accepts both variants. Examples: ??? → standard Pz8/, URL‑safe Pz8_; ~~~ → standard fn5+, URL‑safe fn5-. Data URL: when embedding, use data:[mime];base64,… and decode the part after the comma (this tool extracts it automatically). Milestones (short): 1993 RFC 1521 (MIME v1, Ned Freed & Nathaniel Borenstein) → 1996 RFC 2045 (MIME update, replaces 1521) → 2003 RFC 3548 (Simon Josefsson, abstracts Base16/32/64) → 2006 RFC 4648 (Simon Josefsson, unifies and defines Base64URL, obsoletes 3548). Also: 1993 RFC 1421 (PEM, J. Linn) used Radix‑64 (akin to Base64) to carry binaries in mail. Security note: Base64 is reversible formatting, not confidentiality or integrity. Encrypt first, then encode.

Is Base64 secure?

No. Anyone can decode it. Encrypt first if you need confidentiality

Why “Invalid Base64 format”?

Only A–Z, a–z, 0–9, +, / and = are allowed, and length must be valid

Why do tools produce different results?

Differences often come from line wrapping, whether '=' padding is kept, URL‑safe variant (−/_), and implementation details. Use UTF‑8, disable wrapping, and decide whether to use URL‑safe and keep padding

Why does size increase?

Base64 represents 8 bits via 6; ~33% overhead is inherent

Are emojis/special characters supported?

Yes with UTF‑8. Non‑text binaries may look like gibberish after decode

Base64 Online — Encode & Decode - CrateX.app