64
64Encode

Image to Base64 & CSS/HTML Generator

Drag and drop PNG, JPG, WEBP, GIF, or SVG images to generate raw Base64, Data URIs, <img> tags, and CSS backgrounds.

Decode Base64 to Image on 64Decode

Click or drag & drop an image (PNG, JPG, WebP, GIF, SVG)

Processed 100% locally in your browser

Raw Base64
Data URI
HTML <img> Tag
CSS Background
Technical Guide

Convert PNG, JPG, WebP & SVG Images to Base64, Data URIs & CSS

Inlining small icons, logos, and critical above-the-fold graphics as Base64 Data URIs eliminates extra HTTP requests in HTML emails, single-file widgets, and CSS stylesheets. Drop any image here to get four ready-to-paste formats.

Four Instant Output Formats: Raw, Data URI, HTML & CSS

Every dropped image generates Raw Base64, a full data:image/...;base64,... Data URI, a complete HTML element, and a CSS background-image: url(...) rule.

100% Local Image Processing with Instant Preview

Your brand assets and screenshots are read directly via FileReader.readAsDataURL() in your browser. Need to view or download an image from a Base64 string? Try Base64 to Image on 64Decode.

Frequently Asked Questions

Common Questions

Which image formats can I convert to Base64?

You can convert PNG, JPEG/JPG, WebP, GIF, SVG, and ICO images to Base64 and Data URIs.

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

Raw Base64 is just the encoded character string, while a Data URI includes the data:image/png;base64, prefix required by HTML <img> tags and CSS url().

When should I use Base64 images in CSS or HTML?

Base64 Data URIs work best for small icons, SVG logos, and HTML email templates where external image requests may be blocked.

Are my images uploaded to a server?

No. Images are read locally in browser memory and never transmitted anywhere.

How do I convert a Base64 string back into an image file?

Click Decode Base64 to Image to open the image viewer and downloader on 64Decode.com.