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
π Upload File to Encode
No file selected
βοΈ Options
π€ Decoded Output
πΌοΈ Image Preview
Base64 Character Set (Index Table)
| Index | Char | Binary | Index | Char | Binary | Index | Char | Binary |
|---|
Decoder Performance Metrics
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?
+Paste your Base64 string into the input field, select "Decode" mode, and the tool automatically converts it to readable text. Base64 decoding reverses the encoding process by converting each group of 4 Base64 characters back to 3 bytes of original data. The decoded text appears instantly with auto-convert enabled. For best results, ensure you select the correct character encoding (UTF-8 for most cases) that matches how the data was originally encoded.
Is Base64 encryption or encoding?
+Base64 is encoding, NOT encryption. Encoding transforms data format (binary to text) for compatibility, while encryption secures data with cryptographic algorithms. Anyone can decode Base64 instantly without keys or passwordsβthere's no security. Base64 makes data unreadable to humans but provides zero protection from automated decoding. For security, use proper encryption like AES, RSA, or other cryptographic methods before Base64 encoding if needed for text transmission.
Why does Base64 make data larger?
+Base64 increases data size by approximately 33% because it converts 3 bytes (24 bits) of binary data into 4 Base64 characters (32 bits). Each Base64 character represents only 6 bits of data instead of 8 bits per byte. This "wasted" space is the tradeoff for text compatibility. The extra 33% is acceptable for small data but can be significant for large files. Always compress data before Base64 encoding when size matters, or use binary transfer methods when possible.
What does the padding (=) mean in Base64?
+The equals sign (=) is padding that ensures Base64 strings are always multiples of 4 characters long. When input data length isn't divisible by 3, padding is added: one = if one byte short, two == if two bytes short. Padding tells decoders where actual data ends and padding begins. Some Base64 variants (like URL-safe) omit padding for brevity, but standard Base64 includes it. Decoders can often work with or without padding, but including it follows the official specification.
Can I decode images from Base64?
+Yes! Our tool automatically detects and decodes Base64-encoded images including PNG, JPEG, GIF, SVG, and WebP formats. When you paste a Base64 image string (or data URI like data:image/png;base64,...), the tool decodes the binary image data and displays a preview. You can then download the decoded image as a file. This is useful for extracting images from API responses, JSON data, HTML source code, or email attachments that use Base64 encoding.
What's the difference between Base64 and Base64URL?
+Standard Base64 uses + and / characters which have special meanings in URLs (+ becomes space, / is path separator). Base64URL is a URL-safe variant that replaces + with - (minus) and / with _ (underscore), making encoded strings safe for URLs, filenames, and cookies without escaping. Base64URL often omits padding (=) for brevity. JWT tokens use Base64URL encoding. Our tool supports both formats automatically, detecting and converting between them transparently during decode/encode operations.