Convert images to Base64 strings. Get Data URI, HTML img tag, or CSS background-image output.
I was constantly converting images to Base64 for various projects - embedding icons in CSS, creating self-contained HTML emails, and building single-file demos. Every time, I had to either write a quick script or use some sketchy online tool that wanted to track me. So I built this.
The converter runs entirely in your browser. Drag in an image, get Base64 out. No uploads, no accounts, no limitations. I use it almost daily for small icons and logos that I want to inline directly in my code.
For text encoding, I use the Base64 Encoder/Decoder which handles strings and files. This tool is specifically optimized for images with preview and multiple output formats.
Base64 converts binary image data into ASCII text. This lets you embed images directly in HTML, CSS, or JavaScript without external file references. The trade-off is size - Base64 increases the data by about 33%.
data:image/png;base64,... format. Drop this directly into an img src attribute or CSS url().<img> element with the embedded data. Perfect for quick prototyping.background-image property with data URI. Copy directly into your stylesheet.Embedding isn't always the right choice. Here's my rule of thumb after years of web development:
Email templates are the exception - I embed everything because email clients block external images by default. Users see my images immediately without clicking "load images".
For small UI icons, I often embed them directly in CSS. This eliminates icon loading flash and reduces HTTP requests. The CSS output format gives you exactly what you need:
.icon-check {
background-image: url('data:image/svg+xml;base64,...');
background-size: contain;
width: 24px;
height: 24px;
}You can even embed favicons directly in your HTML head. Useful for single-file HTML applications or when you want the favicon to load instantly:
<link rel="icon" href="data:image/x-icon;base64,..." />Sometimes I need to include images in JavaScript bundles for offline-capable apps. The raw Base64 output works great for this:
const logoBase64 = 'iVBORw0KGgoAAAANSUhEUgAA...';
const logoUrl = `data:image/png;base64,${logoBase64}`;Absolutely. Everything happens in your browser using the JavaScript FileReader API. Your images never leave your computer. I use this tool with client assets and confidential mockups all the time.
The tool accepts images up to 5MB. That said, if you're converting something that large to Base64, you should probably reconsider your approach. Large Base64 strings are unwieldy and hurt performance.
Base64 encoding is standardized, so the actual encoded data should be identical. The difference might be in line breaks (some tools add them every 76 characters) or padding. This tool outputs continuous strings without line breaks.
Yes! Use the Base64 Encoder/Decoder tool in decode mode. Paste your Base64 string and it will display the image.
ICO support varies. The tool converts ICO files correctly, but some browsers don't render ICO data URIs. For maximum compatibility, convert favicons to PNG first.
Drag & drop an image here
or click "Select Image" above
Supported: PNG, JPG, GIF, WebP, SVG, ICO (max 5MB)