Base64 to Image Converter

Convert Base64 strings back to image files

How to Decode Base64 to Image

  1. 1Paste your Base64 encoded image string
  2. 2Remove data URL prefix if present (data:image/...)
  3. 3Preview the decoded image instantly
  4. 4Download in original format (PNG, JPG, etc.)
  5. 5Share decoded images directly to social platforms or messaging apps

When to Use

Share Decoded Images

Quickly share decoded images with team members or on social media

Extract from Data URLs

Convert data URLs back to downloadable image files

Debug Images

Inspect and validate Base64-encoded images during development

API Responses

Extract images from JSON API responses

Frequently Asked Questions

How to convert Base64 to image?

Paste your Base64 string into our tool, preview the image, and download it in its original format.

Why doesn't the image preview show?

Check that your Base64 string is complete and properly formatted. Remove any data URL prefixes like "data:image/png;base64,".

Can I convert to a different image format?

The tool preserves the original format. To convert formats, download the image and use an image editor.

Is my image data secure?

Yes, all conversion happens locally in your browser. Your image data never leaves your device.

Decoding Tips

  • Remove data URL prefixes (data:image/png;base64,) before pasting
  • Validate Base64 string format if preview fails
  • Check image preview before downloading
  • All processing is client-side for privacy

Code Examples

// Decode Base64 to Image
function base64ToImage(base64String) {
  // Remove data URL prefix if present
  const base64 = base64String.replace(/^data:image\/\w+;base64,/, '');

  // Convert to blob
  const byteCharacters = atob(base64);
  const byteArrays = [];

  for (let i = 0; i < byteCharacters.length; i++) {
    byteArrays.push(byteCharacters.charCodeAt(i));
  }

  const byteArray = new Uint8Array(byteArrays);
  return new Blob([byteArray], { type: 'image/png' });
}

// Display image
function displayBase64Image(base64String) {
  const img = document.createElement('img');
  img.src = base64String.startsWith('data:')
    ? base64String
    : `data:image/png;base64,${base64String}`;
  document.body.appendChild(img);
}

// Download image
function downloadBase64Image(base64String, filename = 'image.png') {
  const blob = base64ToImage(base64String);
  const url = URL.createObjectURL(blob);

  const a = document.createElement('a');
  a.href = url;
  a.download = filename;
  a.click();

  URL.revokeObjectURL(url);
}