Image to Base64
Convert any image to a Base64 data URI. Perfect for embedding images directly in HTML, CSS, or JavaScript.
Preview
How to Convert an Image to Base64
Select an image, choose the output format and quality, then click convert. The Base64 data URI is ready to copy and paste into your HTML, CSS, or JavaScript.
Common Uses
- HTML:
<img src="data:image/png;base64,..."> - CSS:
background-image: url(data:image/png;base64,...); - JavaScript:
new Image().src = "data:image/png;base64,..." - JSON APIs: Send images as Base64 strings in JSON payloads
Tips
- Use PNG for images with transparency or text
- Use JPEG for photos — smaller Base64 strings
- WebP offers the best compression but check browser support
- Base64 is best for small images (icons, logos, thumbnails)