Convert any image to a Base64-encoded string for embedding directly in HTML, CSS, JSON or source code — eliminating extra HTTP requests for small assets. Paste the resulting data URL straight into your img tag or CSS background property.
Supports JPG, PNG, WEBP, GIF, SVG — Max 5MB
Paste a Base64 string or Data URL below to decode it back to an image.
Base64 encodes binary data (like images) into ASCII text characters.
Embed images directly into HTML or CSS without needing a separate file request.
Useful for APIs and JSON where binary data needs to be sent as text.
Convert any image to a Base64 encoded string for embedding directly in HTML, CSS or JSON. Eliminate extra HTTP requests by inlining small images as data URLs. Also includes a Base64 decoder to convert encoded strings back to viewable images.
Get Data URL, raw Base64, HTML img tag, and CSS background-image code, ready to use.
Convert image to Base64 AND decode Base64 strings back to viewable/downloadable images.
Files are read and converted locally. No upload, no server processing.
See the Base64-encoded image rendered immediately to verify correctness.
Copy the output in any format with a single click.
Download decoded Base64 images back as PNG files.
Use Base64 for images smaller than 5–10KB. For anything larger, an external file is better because browsers can cache it. A Base64-encoded image is re-downloaded with every page load, while external images are cached after the first visit.
| Use Case | Recommended? | Better Alternative | Notes |
|---|---|---|---|
| Favicon in HTML | ✅ Yes | External .ico file | Small enough that inline is fine |
| CSS background icons (<2KB) | ✅ Yes | SVG sprite | Saves HTTP request for tiny icons |
| Email inline images | ✅ Yes | External URL | Email clients block external images |
| API image transfer | ✅ Yes | File upload endpoint | Common in REST APIs and webhooks |
| Hero images (>10KB) | ❌ No | External file with srcset | 33% overhead + no caching |
| Images used site-wide | ❌ No | External CDN file | Browser caches external files |
| Profile photos | ❌ No | Cloud storage URL | User-uploaded content needs CDN |