DevDockTools

Image to Base64

Convert images to Base64-encoded data URLs for embedding directly in HTML, CSS, or JavaScript without external file references. Supports all common image formats.

Base64 encoding converts binary image data to a string of ASCII characters that can be embedded directly in HTML or CSS without a separate file request. The trade-off: Base64 increases file size by ~33%, so it is best suited to small icons under 5KB.

Inline critical CSS background iconsEmail HTML with embedded imagesSingle-file HTML exportsReact / Vue component inline images
100% private — all processing runs in your browser. No files are uploaded to any server.

Drag & drop or click to upload

Supports PNG, JPG, WebP, GIF, SVG, BMP — max 10 MB

Frequently Asked Questions

When should I use Base64 images?

Base64 is useful for small icons and critical above-the-fold images to eliminate HTTP requests. Avoid it for large images — Base64 encoding increases file size by ~33%.

Can I use the output in CSS?

Yes. Paste the output directly as a CSS background-image: url('data:image/...') value.

How much larger will the Base64 string be?

Base64 encoding increases binary data size by approximately 33%. A 10KB PNG becomes roughly 13.3KB as a Base64 string. For large images, this overhead significantly increases page size.

Is my image uploaded to a server?

No. Encoding is done entirely in your browser using the FileReader API. Your images are never transmitted anywhere.

Related Tools