Guide

MEDIA & IMAGE ENCODING · BASE64 DATA URI, HTML, CSS & DECODER

Image to Base64 Converter,
encode Data URIs or decode back to files.

Convert PNG, JPEG, GIF, and WebP images to Base64 Data URIs, HTML, CSS, Markdown, or JSON—or decode Base64 strings back into downloadable images locally in your browser.

1. Upload Image or Paste Base64

Drop an image, paste screenshot (Ctrl/Cmd+V), or click to browsePNG, JPEG, GIF, or WebP · Max 5 MiB · Never leaves your device
Drop an image file or paste Base64 / Data URI to convert.

2. Output & Live Preview

BASE64 FORMAT SIGNATURES & SIZE OVERHEAD

Supported image formats, Base64 prefixes & inline size guidance.

FormatMIME TypeBase64 PrefixBest Inline Use
PNGimage/pngiVBORw0KGgo...Crisp UI icons, badges & transparent logos
WebPimage/webpUklGR...Smallest inline payload for modern web apps
JPEGimage/jpeg/9j/...Tiny preview thumbnails & LQIP blur-up placeholders
GIFimage/gifR0lGODlh...1×1 tracking pixels & micro loading indicators

When to Inline Images as Base64 vs. Serving Static Files

Great for Small Assets (< 10 KB)

Eliminates extra HTTP requests for tiny UI icons, favicons, inline email badges, and self-contained single-file HTML templates.

Avoid for Large Photos

Base64 adds ~33% payload overhead and prevents the browser from caching the image independently of your HTML or CSS bundle.

Frequently Asked Questions

Does this tool upload my images to a server?

No. Encoding and decoding happen 100% locally in your browser using the FileReader and Blob APIs. Your images never leave your device.

Why is the Base64 string about 33% larger than the original image?

Base64 represents every 3 bytes of binary data as 4 ASCII text characters, adding roughly 33% size overhead. It is ideal for small icons, logos, and email embeds (under 10–20 KB), while larger photos are better served as regular image files.

Can I convert a Base64 string back into a downloadable image?

Yes. Paste either a raw Base64 string or a full data:image/... URI into the input box, click "Decode Base64", verify the live preview, and click "Download Image".

Which image formats are supported?

PNG, JPEG, GIF, and WebP files up to 5 MiB are supported with automatic magic-byte file signature detection.

What is the difference between Raw Base64 and a Data URI?

Raw Base64 is just the encoded characters (starting with iVBOR... for PNG or /9j/... for JPEG). A Data URI adds the prefix data:image/png;base64, so browsers can render it directly inside HTML <img> tags or CSS url() rules.