Base64 Decode & Encode – Free Online Base64 Decoder Tool

Base64 Decode & Encode

Free online Base64 decoder and encoder tool. Decode Base64 strings to text, binary, or images, and encode text or files to Base64 format instantly with support for UTF-8, UTF-16, and various character encodings.

πŸ“₯ Base64 Input

0 characters

βš™οΈ Options

πŸ“€ Decoded Output

0 characters

Base64 Character Set (Index Table)

Index Char Binary Index Char Binary Index Char Binary

Decoder Performance Metrics

Decoding Accuracy 100/100
Processing Speed 99/100
Format Support 98/100
Error Handling 97/100
User Experience 99/100

How to Use Base64 Decoder

Step 1: Choose Operation Mode

Select Decode to convert Base64 strings back to original text, binary, or images. Choose Encode to convert plain text or files into Base64 format. The interface adapts automatically based on your selection, showing relevant options and placeholders for each operation mode.

Step 2: Enter Your Data

For decoding, paste your Base64 string into the input field. The tool accepts standard Base64, URL-safe Base64, and MIME-formatted Base64 with line breaks. For encoding, type your text or upload a file. Use the Sample button to load example data or Paste to quickly insert from clipboard.

Step 3: Configure Options

Select character encoding (UTF-8, UTF-16, ASCII, Latin-1) for decoding to ensure proper character interpretation. For encoding, choose output format (standard, URL-safe, or MIME). Enable auto-detect to automatically identify data types like images. Strip whitespace removes formatting characters that might cause decoding errors.

Step 4: Convert and Export

With auto-convert enabled, results appear instantly as you type. Otherwise, click Convert Now. Decoded images display in a preview window. Use Copy to copy results to clipboard, Download to save as a file, or Swap to reverse the conversion direction.

Key Features

⇄

Bidirectional Conversion

Decode Base64 strings to text/binary or encode text/files to Base64 format. Single tool handles both operations with instant mode switching, perfect for developers working with Base64 encoding in APIs, databases, or data transmission.

πŸ–ΌοΈ

Image Decode & Preview

Automatically detect and decode Base64-encoded images with instant preview. Supports PNG, JPEG, GIF, SVG, and WebP. Perfect for extracting images from API responses, JSON data, or HTML data URIs for inspection or downloading.

🌐

Multiple Encodings

Support for UTF-8, UTF-16, ASCII, and Latin-1 character encodings ensures accurate decoding of international characters, emojis, and special symbols. Choose the right encoding to match your data source for perfect character interpretation.

πŸ”

Auto-Detection

Intelligent auto-detection identifies data types including text, images, PDFs, and binary files. Automatically strips whitespace and handles different Base64 formats (standard, URL-safe, MIME) for hassle-free decoding without format guessing.

πŸ“

File Upload Support

Upload files directly for Base64 encoding instead of copying text manually. Perfect for encoding images, documents, PDFs, or any file type for embedding in HTML, JSON, or transmitting via text-based protocols without binary support.

⚑

Real-Time Conversion

Auto-convert feature processes Base64 strings instantly as you type with no delays. All processing happens client-side in your browser for maximum speed and complete privacy. No server uploads means your data stays secure.

Understanding Base64 Encoding

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format using 64 different characters. The character set includes A-Z (26 letters), a-z (26 letters), 0-9 (10 digits), and two symbols (+ and /), totaling 64 characters. Each Base64 character represents exactly 6 bits of data, allowing binary files to be transmitted safely through systems that only support text.

Base64 encoding converts every 3 bytes (24 bits) of input data into 4 Base64 characters (24 bits = 4 Γ— 6 bits). This means encoded data is approximately 33% larger than the original. Padding characters (=) are added when input length isn't divisible by 3. While Base64 increases size, it ensures binary data can travel through email systems, JSON APIs, XML documents, and other text-based protocols without corruption.

Base64 Encoding Formula

The encoding process divides binary input into 6-bit groups and maps each group to a Base64 character using an index table. The mathematical relationship for encoded size is:

Base64 Encoded Size:

Encoded Length = ⌈(n / 3)βŒ‰ Γ— 4

where n = number of input bytes, βŒˆβŒ‰ = ceiling function

Example: Encoding the word "Man" (3 bytes): M = 0x4D = 01001101, a = 0x61 = 01100001, n = 0x6E = 01101110. Combined: 010011010110000101101110. Split into 4 Γ— 6-bit groups: 010011 (19='T'), 010110 (22='W'), 000101 (5='F'), 101110 (46='u'). Result: "TWFu"

Common Use Cases

πŸ“§ Email Attachments

Email systems were designed for text, not binary data. MIME (Multipurpose Internet Mail Extensions) uses Base64 to encode file attachments for safe transmission. Decode Base64 strings from email source code or encode files for embedding in email systems and templates.

πŸ”Œ API Data Transfer

REST APIs and JSON responses use Base64 to transmit binary data like images, PDFs, or files without special handling. Decode Base64 from API responses to extract files or encode binary data for POST/PUT requests in web services and microservices architectures.

πŸ—„οΈ Database Storage

Store binary files in text-based database fields using Base64. Common in NoSQL databases like MongoDB or when storing small images, documents, or certificates in SQL VARCHAR/TEXT columns. Decode stored Base64 strings to retrieve original files.

🌐 Data URIs in HTML

Embed images directly in HTML/CSS using data URIs (data:image/png;base64,...) to reduce HTTP requests. Decode data URIs to extract embedded images or encode images for inline embedding in single-page applications, email templates, or offline HTML documents.

πŸ” Authentication Tokens

HTTP Basic Authentication encodes credentials as Base64 in the Authorization header. JWT (JSON Web Tokens) use Base64URL encoding for token components. Decode authentication headers for debugging or testing, though remember Base64 is encoding, not encryption.

πŸ“„ Configuration Files

Store binary configuration data, certificates, or keys in text-based config files (JSON, YAML, XML) using Base64. Kubernetes secrets, SSL certificates, and encryption keys are commonly Base64-encoded in configuration management for text-based storage and version control systems.

Frequently Asked Questions

How do I decode Base64 to text?

+

Is Base64 encryption or encoding?

+

Why does Base64 make data larger?

+

What does the padding (=) mean in Base64?

+

Can I decode images from Base64?

+

What's the difference between Base64 and Base64URL?

+