Skip to main content

Image to Base64

Convert any image to a Base64 data URL for embedding in HTML, CSS, or JSON.

Frequently Asked Questions

When should I inline an image as Base64?

For very small images (icons, logos under ~2KB) where an extra HTTP request hurts more than the ~33% size inflation Base64 causes. For larger images, keep them as separate files.

Does Base64 encoding reduce quality?

No. Base64 is lossless encoding. The resulting file is about 33% larger than the original binary.

How do I use the output in HTML?

Paste into the src attribute of an <img> tag: <img src="data:image/png;base64,..." />

Related Tools