Encode / Decode

Encode / Decode

Base64 encoder and decoder online. Encode text to Base64 or decode Base64 strings instantly in your browser with automatic input detection.

0 chars

Plain Text

Base64 Output

Features

  • Auto-detect: Automatically determines if input should be encoded or decoded
  • Binary Support: Detects file data (Images, PDF, ZIP) and offers download
  • UTF-8 Safe: Properly handles unicode characters including emoji 🎉
  • Validation: Shows detailed errors for invalid Base64 strings

Features

  • Instant Base64 encoding and decoding
  • Automatic input detection (text or Base64)
  • Support for UTF-8 text encoding
  • Character and byte count statistics
  • Client-side processing (no server uploads)
  • Copy encoded/decoded output with one click

Common Use Cases

  • Encode credentials for HTTP Basic Authentication
  • Embed small files in HTML, CSS, or JSON
  • Decode Base64 strings from API responses
  • Convert binary data to text-safe format
  • Share text data in URL-safe format

Understanding Base64 Encoding

Base64 is a binary-to-text encoding scheme that converts binary data into ASCII text using 64 printable characters. It's widely used for transmitting binary data over text-only channels.

Why Base64?

  • Text-safe - Converts binary data to ASCII characters
  • Email compatible - Works in MIME email attachments
  • URL embedding - Embed images and files in HTML/CSS
  • API transmission - Send binary data in JSON

How it works: Base64 takes every 3 bytes (24 bits) of input and divides them into four 6-bit groups. Each 6-bit group is mapped to one of 64 characters (A-Z, a-z, 0-9, +, /).

Note: Base64 increases data size by approximately 33% due to encoding overhead.

Examples

Valid - Encoding text to Base64
Input: Hello, World!
Output: SGVsbG8sIFdvcmxkIQ==
Valid - Decoding Base64 string
Input: SGVsbG8sIFdvcmxkIQ==
Output: Hello, World!
Invalid - Invalid Base64 (incorrect padding)
SGVsbG8sIFdvcmxkIQ=
// Missing one = padding character

Frequently Asked Questions

What is Base64 encoding used for?

Base64 encoding converts binary data into ASCII text, making it safe for transmission over text-only protocols like email, JSON, and XML. Common uses include encoding images for HTML/CSS embedding, transmitting file data in APIs, and encoding credentials for HTTP Basic Authentication.

Does Base64 provide encryption or security?

No. Base64 is an encoding scheme, not encryption. It makes data text-safe but offers zero security. Anyone can decode Base64 instantly. Never use Base64 alone to protect sensitive data—use proper encryption instead.

Why does Base64 increase file size?

Base64 encoding increases data size by approximately 33%. This happens because it converts every 3 bytes (24 bits) into 4 Base64 characters (32 bits). The overhead is necessary to ensure the output uses only printable ASCII characters.

What are the = characters at the end of Base64 strings?

The = characters are padding. Base64 processes data in 3-byte chunks. If the input isn't divisible by 3, padding (= or ==) is added to complete the final group. Some decoders are lenient with missing padding, but proper Base64 should include it.

Can Base64 encode any type of file?

Yes! Base64 can encode any binary data—images, PDFs, videos, ZIP files, executables, etc. However, for large files, Base64 is inefficient due to the 33% size increase. It's best suited for small files and embedding data directly in text formats.