Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 strings instantly. Supports full UTF-8 including emoji and non-Latin scripts. Useful for data URIs, API payloads, email encoding, and embedding binary data in text formats. 100% browser-based — no data uploaded.

100% FreeZero Server ProcessingDeveloper Favorite
Your Data Stays Private

All encoding and decoding happens in your browser. Nothing is transmitted to any server. When you close this tab, your data is gone.

Output

Key Facts

  • Encoding: Base64 converts binary data into 64 ASCII characters (A-Z, a-z, 0-9, +, /) with = padding
  • Size Overhead: Base64 output is approximately 33% larger than the original input (3 bytes become 4 characters)
  • UTF-8 Support: Handles full Unicode including accented characters, emoji, CJK, and Arabic scripts
  • Not Encryption: Base64 is encoding, not encryption. It provides no security. Use AES-256 for actual encryption
  • Common Uses: Data URIs in HTML/CSS, API request bodies, email MIME encoding, JWT token segments, embedding images in JSON

Common Base64 Use Cases

  • Data URIs: Embed small images directly in HTML or CSS using data:image/png;base64,... to reduce HTTP requests
  • API Authentication: HTTP Basic Authentication encodes username:password as Base64 in the Authorization header
  • Email Attachments: MIME encoding uses Base64 to embed binary attachments in text-based email protocols
  • JWT Tokens: JSON Web Tokens use Base64url encoding for the header and payload segments
  • Binary in JSON/XML: Safely transmit binary data (images, files, certificates) through text-only formats
  • Configuration Files: Store binary keys, certificates, or secrets in text-based config files like YAML or .env

How Base64 Encoding Works

  • Step 1 — Binary Conversion: Input text is first converted to its binary representation (UTF-8 bytes)
  • Step 2 — 6-Bit Grouping: Binary data is split into groups of 6 bits (instead of the normal 8-bit bytes)
  • Step 3 — Character Mapping: Each 6-bit group maps to one of 64 characters: A-Z (0-25), a-z (26-51), 0-9 (52-61), + (62), / (63)
  • Step 4 — Padding: If the input length is not divisible by 3, one or two = characters are appended as padding
  • Base64url Variant: Uses - instead of + and _ instead of / to be URL-safe. No padding. Used in JWTs and URLs

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into a set of 64 ASCII characters. It is commonly used to embed binary data in text-based formats like JSON, XML, HTML data URIs, and email attachments (MIME). The name comes from the 64-character alphabet used in the encoding.

Is Base64 encryption?

No. Base64 is encoding, not encryption. It provides zero security or confidentiality. Anyone can decode a Base64 string instantly. If you need to protect sensitive data, use actual encryption like AES-256.

Why does Base64 make data larger?

Base64 encoding increases data size by approximately 33%. Every 3 bytes of input become 4 Base64 characters (6 bits each instead of 8). This overhead is the tradeoff for safely transmitting binary data through text-only channels that might corrupt raw binary.

Does this tool handle UTF-8 and emoji?

Yes. Our encoder first converts text to UTF-8 bytes before Base64 encoding, correctly handling accented characters, emoji, Chinese, Japanese, Arabic, and all other Unicode scripts. The decoder reverses this process.

What is the difference between Base64 and Base64url?

Standard Base64 uses + and / characters which are not safe in URLs. Base64url replaces + with - and / with _ and omits the = padding. It is used in JWTs, URL parameters, and filename-safe contexts.