Zero HTTP Request Data-URI Encoder

Convert Image to Base64 Data URI Online

Convert PNG, JPG, WebP, and AVIF images into inline Base64 data strings. Copy directly into HTML <img>, CSS background-image, or CSS variables.

Upload image to convert to Base64 Data URI

Zero-HTTP-request inline image code for CSS backgrounds and HTML tags.

Browse Files
Developer Optimization Guide

When to Use Base64 Data URIs (and When to Avoid Them)

Base64 inlines images directly into HTML or CSS files, eliminating network requests. Understanding its trade-offs is essential for high-performance websites.

Zero HTTP Roundtrips

Embedding small UI icons or loading spinners as Base64 eliminates browser connection latency, preventing flash-of-unstyled-content (FOUC).

4 One-Click Copy Formats

Copy as raw URI, CSS background-image: url('data:...'), HTML <img src="...">, or CSS custom variable --bg: url('...').

Smart Size Inflation Warning

Base64 encoding increases byte size by ~37%. Ayeri tracks string length and alerts you when an image is too large for efficient Base64 inlining.

Frequently Asked Questions About Base64 Encoding

Yes. Base64 represents 3 binary bytes with 4 ASCII characters, resulting in approximately a 33% to 37% size increase. Therefore, Base64 is best used for small icons, logos, or spinners under 10 KB to eliminate HTTP request latency.