Base64 Decoder

Decode Base64 strings back to original format

How to Decode Base64

  1. 1Paste your Base64 encoded string into the input area
  2. 2The tool automatically decodes it to readable text
  3. 3Click the copy button to copy the decoded result
  4. 4Download as file if needed for binary data

When to Decode Base64

API Response Data

Extract original content from Base64-encoded API responses

Email Attachments

Decode MIME-encoded email attachments back to original files

Data URL Extraction

Extract embedded images or files from data URLs

Debug & Inspect

Inspect and debug Base64 strings during development

Frequently Asked Questions

How do I decode a Base64 string?

Simply paste your Base64 string into our decoder tool. It will automatically convert it back to the original text or binary data.

Can I decode images from Base64?

Yes, use our specialized Base64 to Image tool for better handling of image data with preview and download options.

What if the decoded text looks corrupted?

The Base64 string might be incomplete, corrupted, or represent binary data that appears as garbled text. Try our specialized converters for images or PDFs.

Is it safe to decode Base64 strings?

Decoding itself is safe, but always validate and sanitize the decoded content before using it in your application to prevent security issues.

Decoding Tips

  • Remove any data URL prefixes (data:image/png;base64,) before decoding
  • Ensure the Base64 string has no line breaks or spaces
  • Validate the decoded output before using it
  • Use specialized tools for images, PDFs, and other binary formats

Code Examples

// Decode Base64 to text
const encoded = "SGVsbG8sIFdvcmxkIQ==";
const decoded = atob(encoded);
console.log(decoded); // Hello, World!

// Decode UTF-8 Base64 (for special characters)
function decodeUTF8(base64) {
  const binary = atob(base64);
  const bytes = new Uint8Array(binary.length);
  for (let i = 0; i < binary.length; i++) {
    bytes[i] = binary.charCodeAt(i);
  }
  return new TextDecoder().decode(bytes);
}

// Decode Base64 to Blob (for files)
function base64ToBlob(base64, mimeType = 'application/octet-stream') {
  const byteCharacters = atob(base64);
  const byteArrays = [];
  for (let i = 0; i < byteCharacters.length; i++) {
    byteArrays.push(byteCharacters.charCodeAt(i));
  }
  return new Blob([new Uint8Array(byteArrays)], { type: mimeType });
}