Base64 Decode Online

Decode Base64 strings to plain text instantly

100% client-side ยท your data never leaves your browser

๐Ÿ“– How to Use

  1. Paste your Base64 string in the input field
  2. The decoded plain text appears automatically in real-time
  3. Click "Copy" to copy the decoded result to your clipboard
  4. Use "Switch Mode" to encode the output back to Base64
  5. Click "Clear" to reset both fields

About the Base64 Decoder

The Base64 Decoder is a free, browser-based tool that instantly converts Base64-encoded strings back to their original plain text format. Whether you're debugging API responses, inspecting JWT tokens, or decoding data from databases and configuration files, this tool provides real-time decoding with complete privacy. All processing happens locally in your browser - no data is ever transmitted to external servers, making it safe for sensitive or confidential information.

Key Features:

  • Real-time decoding as you paste with instant results
  • 100% client-side processing - your data never leaves your browser
  • No registration, login, or installation required
  • Supports both standard Base64 and Base64URL formats
  • Switch between decode and encode modes seamlessly
  • Mobile-friendly responsive interface for decoding on any device

Common Use Cases:

  • JWT Token Inspection: Decode Base64-encoded JWT header and payload sections to inspect claims and metadata (also try our JWT Debugger)
  • API Response Debugging: Decode Base64-encoded data from API responses to view the actual content
  • Database Content: Decode Base64-stored data from databases to view original text or verify data integrity
  • HTTP Authentication: Decode Basic Auth headers to verify encoded credentials (for debugging only)
  • Email Attachments: Decode MIME email attachment data to inspect content or verify encoding

Base64 Decoding Examples & Use Cases

HTTP Basic Authentication Header

// Encoded: dXNlcm5hbWU6cGFzc3dvcmQ=
// Decoded: username:password

// JavaScript:
const decoded = atob('dXNlcm5hbWU6cGFzc3dvcmQ=');
console.log(decoded); // "username:password"

// Extract from Authorization header:
const auth = 'Basic dXNlcm5hbWU6cGFzc3dvcmQ=';
const credentials = atob(auth.split(' ')[1]);

Use case: Decode HTTP Basic Auth headers to debug authentication issues (never log production credentials)

JWT Token Payload Decoding

// JWT Token (3 parts): header.payload.signature
// Decode just the payload section:

const jwt = 'eyJ...header...eyJ...payload...signature';
const payload = jwt.split('.')[1];
const decoded = atob(payload);

// Decoded JSON:
{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022,
  "exp": 1516242622
}

Use case: Inspect JWT payload claims to debug authentication or verify token expiration

Database Stored Base64 Data

// SQL Query Result:
SELECT config_value FROM settings WHERE config_key = 'api_key';
// Result: c2stbGl2ZV8xMjM0NTY3ODkw

// Decode to original:
// Decoded: sk-live-1234567890

// Python example:
import base64
decoded = base64.b64decode('c2stbGl2ZV8xMjM0NTY3ODkw').decode('utf-8')
print(decoded)  # "sk-live-1234567890"

Use case: Retrieve original values from Base64-encoded database fields

Base64URL Decoding (URL-Safe Variant)

// Standard Base64: YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo+Pz8/
// Base64URL:      YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo-Pz8_

// JavaScript decoder for Base64URL:
function decodeBase64URL(str) {
  // Replace URL-safe characters
  str = str.replace(/-/g, '+').replace(/_/g, '/');
  // Add padding if needed
  while (str.length % 4) str += '=';
  return atob(str);
}

Use case: Decode Base64URL format used in JWT tokens and URL parameters

Email MIME Content Decoding

// MIME email with Base64 content:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64

SGVsbG8sIFdvcmxkIQpUaGlzIGlzIGEgdGVzdCBlbWFpbC4=

// Decoded content:
Hello, World!
This is a test email.

Use case: Decode MIME-encoded email content to view the actual message text

Configuration File Values

// .env file or config.json:
DATABASE_URL=base64:cG9zdGdyZXNxbDovL3VzZXI6cGFzc0Bsb2NhbGhvc3Q6NTQzMi9kYg==

// Decoded:
postgresql://user:pass@localhost:5432/db

// Node.js decoder:
const encoded = process.env.DATABASE_URL.replace('base64:', '');
const decoded = Buffer.from(encoded, 'base64').toString('utf-8');

Use case: Decode Base64-encoded configuration values to inspect connection strings

โ“ Frequently Asked Questions

What is Base64 decoding and how does it work?

Base64 decoding is the reverse process of Base64 encoding - it converts Base64-encoded text back into its original format (plain text or binary data). The decoder takes groups of four Base64 characters and converts them back to three bytes of original data. Each Base64 character represents 6 bits of data, so four characters (24 bits) decode to three bytes (24 bits) of original content.

How do I decode Base64 online with this tool?

Simply paste your Base64 string into the input field and the decoded result appears automatically in real-time. The tool validates the Base64 format and shows an error if the input is invalid. Click the copy button to copy the decoded text to your clipboard. You can also switch to encode mode to convert the output back to Base64.

What does "Invalid Base64 string" mean?

This error appears when the input contains characters that aren't valid in Base64 format, or when the string length isn't properly padded. Base64 only uses A-Z, a-z, 0-9, +, /, and = for padding. Common causes include copy-paste errors, truncated strings, or trying to decode text that isn't Base64-encoded.

Is my data safe when using this Base64 decoder?

Yes, absolutely! All Base64 decoding happens entirely in your browser using client-side JavaScript. Your data never leaves your device or gets sent to any server. We don't log, store, or track any of your data, making it completely safe to decode even sensitive Base64 strings (though remember Base64 is not encryption).

Can I decode Base64URL format?

Yes, this tool handles both standard Base64 and Base64URL formats. Base64URL replaces + with - (minus) and / with _ (underscore) to make the string URL-safe. The tool automatically detects and decodes both variants. Base64URL is commonly used in JWT tokens and URL-safe identifiers.

What happens if I decode binary data (images, files)?

When you decode Base64 that represents binary data (like images or PDFs), the output will appear as garbled characters because binary data isn't human-readable text. For files, you would need specialized tools that can reconstruct the binary file. This tool is designed primarily for text-based Base64 decoding.

Why do some Base64 strings end with = or ==?

The = character is padding used to ensure the Base64 string length is a multiple of 4. One = means 2 bytes of original data, two == means 1 byte. Padding ensures proper decoding. Base64URL format often omits padding, which is why you might see strings without = at the end.

Can I decode large Base64 strings?

Yes, this tool can handle large Base64 strings up to several megabytes. However, extremely large strings (over 10MB) may impact browser performance. For very large files, consider using command-line tools like base64 on Linux/Mac or certutil on Windows for better performance.

๐Ÿ”— Related Tools