Base64 Encoder / Decoder

Online Base64 Encoder & Decoder

Our free online Base64 Encoder & Decoder allows you to convert text to Base64 encoding and decode Base64 strings back to readable text instantly. All processing happens in your browser - your data never leaves your device.

Features:

  • Instant Encoding: Convert any text to Base64 format with a single click.
  • Quick Decoding: Decode Base64 strings back to their original text instantly.
  • Unicode Support: Properly handles UTF-8 characters including emojis and special symbols.
  • Swap Function: Easily swap input and output to perform reverse operations.
  • Secure & Private: All encoding/decoding happens locally in your browser.

1. What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters. It's commonly used to encode data that needs to be stored or transferred over media designed for text. The character set includes A-Z, a-z, 0-9, +, and /, with = used for padding.

2. Common Use Cases

Email Attachments: MIME encoding uses Base64 for binary attachments
Data URLs: Embedding images directly in HTML/CSS
API Authentication: Basic Auth headers use Base64 encoding
JSON/XML Data: Encoding binary data for text-based formats
Storing Binary in Databases: When binary fields aren't available

3. How Base64 Works

Base64 encoding takes 3 bytes (24 bits) of input and converts them into 4 ASCII characters (6 bits each). This means Base64-encoded data is approximately 33% larger than the original. If the input isn't divisible by 3 bytes, padding (=) is added.

4. Base64 vs Other Encodings

Unlike URL encoding which only escapes special characters, Base64 converts ALL data. It's not encryption - Base64 is easily reversible and provides no security. For secure transmission, always use HTTPS and proper encryption.

5. Limitations

Base64 increases data size by ~33%, so it's not ideal for large files. Some Base64 variants exist (URL-safe Base64 uses - and _ instead of + and /). Very long Base64 strings may have line breaks in some implementations.


This Base64 tool allows developers to quickly encode and decode data without any software installation.

100% client-side processing ensures your data remains private and secure.

Related Tools

url-encoder-decoder

html-encoder-decoder

hex-string-converter

Understanding Base64 Encoding

The Base64 Alphabet:

The standard Base64 alphabet consists of 64 characters: uppercase letters (A-Z), lowercase letters (a-z), digits (0-9), plus (+), and forward slash (/). The equals sign (=) is used for padding when the input length isn't a multiple of 3 bytes.

Encoding Process:

1. Convert input text to binary (using ASCII or UTF-8)
2. Split binary into groups of 6 bits
3. Convert each 6-bit group to its Base64 character
4. Add padding (=) if needed to make output length divisible by 4

Real-World Examples:

Data URIs: data:image/png;base64,iVBORw0KGgo...
Basic Auth: Authorization: Basic dXNlcjpwYXNz
JWT Tokens: Header and payload sections are Base64URL encoded
Email: MIME uses Base64 for non-ASCII content

URL-Safe Base64:

Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 (Base64URL) replaces + with - and / with _. This variant is used in JWTs, data URLs, and anywhere Base64 appears in URLs.