logo
logo

Base64 Encode & Decode

Encode and decode Base64 strings online for free. Convert text to Base64 and back instantly. Perfect for developers. No signup required!

Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to text

Free Base64 Encode & Decode Online - Encoder/Decoder Tool

Encode and decode Base64 strings online for free. Convert text to Base64 and back instantly—essential for developers working with APIs, data transmission, and encoding binary data as text. No signup required, and all processing happens in your browser.

What Is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, and /). It's designed to safely transmit binary data through systems that only handle text, like email or URLs.

The name "Base64" comes from the 64 different characters used in the encoding alphabet.

How to Use

Encoding

  1. Enter text - Type or paste your text in the input field
  2. Click "Encode" - Convert to Base64
  3. Copy result - Use the encoded string

Decoding

  1. Paste Base64 - Enter your encoded string
  2. Click "Decode" - Convert back to original text
  3. View result - See the decoded content

Key Features

  • Instant conversion - Real-time encoding/decoding
  • UTF-8 support - Handles special characters and emoji
  • No character limit - Process any text length
  • Bidirectional - Encode and decode in one tool
  • Privacy-first - All processing happens locally
  • One-click copy - Easy clipboard access

How Base64 Works

Encoding Process

  1. Convert text to binary (ASCII/UTF-8 values)
  2. Group binary data into 6-bit chunks
  3. Map each 6-bit chunk to a Base64 character
  4. Add padding (=) if necessary

Example

Text: "Hi"
Binary: 01001000 01101001
6-bit groups: 010010 000110 1001
With padding: 010010 000110 100100
Base64: SGk=

The Base64 Alphabet

A-Z → Values 0-25
a-z → Values 26-51
0-9 → Values 52-61
+   → Value 62
/   → Value 63
=   → Padding character

Use Cases

Web Development

  • Embedding images - Data URLs for inline images
  • API authentication - Basic auth headers
  • JWT tokens - Token payload encoding
  • Data transmission - Safe text-based data transfer
  • Cookie values - Complex data in cookies

Email & Communication

  • Email attachments - MIME encoding
  • HTML content - Binary data in HTML
  • Data URIs - Inline resources
  • Config files - Secrets in environment variables

Data Storage

  • Database strings - Store binary as text
  • JSON payloads - Binary files in JSON
  • XM content - Embed data in XML
  • Clipboard operations - Complex data copying

Development & DevOps

  • Secret management - Kubernetes secrets
  • Certificate handling - SSL/TLS certificates
  • SSH keys - Key storage and transfer
  • Container configs - Encoded configurations

Base64 Variants

VariantCharactersUse Case
StandardA-Z, a-z, 0-9, +, /General use
URL-safeA-Z, a-z, 0-9, -, _URLs and filenames
MIMEStandard + line breaksEmail attachments

Size Considerations

Base64 encoding increases data size by approximately 33%:

  • Original: 3 bytes → Encoded: 4 characters
  • 1 MB file → ~1.33 MB Base64 string

This overhead is the trade-off for text-safe transmission.

Common Use Examples

HTTP Basic Authentication

Username:Password → Base64
user:pass123 → dXNlcjpwYXNzMTIz
Header: Authorization: Basic dXNlcjpwYXNzMTIz

Data URL for Images

data:image/png;base64,iVBORw0KGgoAAAANSUhE...

Environment Variables

SECRET_KEY=SGVsbG8gV29ybGQh

Frequently Asked Questions

Is Base64 encryption?

No! Base64 is encoding, not encryption. Anyone can decode Base64—it provides no security. It's designed for data format conversion, not protection.

Why does my Base64 end with "="?

The "=" character is padding. Base64 works with 6-bit groups, and padding ensures the output length is a multiple of 4 characters.

Can I use Base64 for security?

Never rely on Base64 for security. It's trivially reversible. For security, use proper encryption (AES, RSA) or hashing (SHA-256).

Why won't my Base64 decode?

Common issues:

  • Extra whitespace or line breaks
  • URL-safe encoding (- and _ instead of + and /)
  • Incomplete or corrupted string
  • Wrong character encoding

What's the difference between Base64 and Base32?

Base32 uses 32 characters (A-Z, 2-7) and is less efficient but case-insensitive. Base64 is more compact but requires case-sensitive handling.

Can I encode files?

This tool handles text. For files, you'd need to first read the file's binary content as a byte array, then encode it.