7 minute guide · Updated August 23, 2026

How to decode Base64 to an image safely

Normalize a Base64 value, detect the real image type from bytes, preview it safely, and download the result.

Remove obvious wrappers and whitespace, decode with a size limit, and check magic bytes instead of trusting a filename or Data URI label.

Do it here

Convert Base64 to an image

Paste a Base64 blob and immediately see its detected type, dimensions, and decoded size.

Runs here in your browser. Very large values are blocked before decoding to protect the tab.

Your decoded image appears here.

Browser-only tool. The image or Base64 value is not uploaded.

Identify the payload

A value may be raw Base64, a Data URI, or a quoted JSON string. Extract only the obvious wrapper and reject malformed alphabet or padding rather than guessing at arbitrary text.

Trust decoded bytes over labels

A Data URI can claim one MIME type while containing another. JPEG, PNG, GIF, WebP, and other formats carry recognizable signatures that provide a stronger type check.

Treat decoded SVG as active content

SVG can contain script-like features and external references. Do not inject unknown decoded markup with innerHTML. A safe viewer can reject it or keep it isolated as non-executing text.