What is a Base64 image data URI?+
It is the entire file rewritten as a URL. The string opens with data:image/png;base64, and everything after the comma is the file's bytes spelled out in the 64-character alphabet of letters, digits, plus, and slash. Because the picture travels inside the reference, whatever loaded the stylesheet or the HTML already has the image, and no second request is made for it.
Why Base64 rather than percent-encoding, when SVG is better percent-encoded?+
Because the bytes are binary. Percent-encoding leaves printable ASCII alone and spends three characters on everything else, which is a bargain for markup and a disaster for a PNG: compressed image data is close to random, so nearly every byte would need escaping and the string would land near triple the file size. Base64 charges a flat four characters per three bytes whatever the content, and its alphabet needs no further escaping in CSS, HTML, or JSON. For text-based SVG the trade reverses, which is why that format has its own page here.
Does inlining an image actually make a page faster?+
For one small asset on the critical path, usually yes: a request has fixed costs in connection setup, headers, and latency that dwarf a 600-byte icon. Beyond that the answer turns negative quickly. The bytes join a file that blocks rendering, they are re-downloaded whenever that file changes, they cannot be lazy-loaded or deprioritised, and they cannot be fetched in parallel the way a separate URL would be. Inlining trades a request for weight in the wrong place; it only pays while the weight is trivial.
How much larger is the encoded version, exactly?+
The payload is ceil(bytes / 3) × 4 characters (a flat 33.3% before rounding) plus the padding needed to reach a multiple of four, plus the roughly twenty-byte data:…;base64, prefix. A 10 KB PNG becomes about 13.4 KB of text. Compression does not rescue it either: gzip and brotli work on repetition, and an already-compressed image has almost none left, so you recover a couple of percent rather than the premium.
Which formats work, and which do not?+
PNG, JPEG, WebP, GIF, AVIF, BMP, and ICO all encode and render as data URIs, and SVG is accepted here too though it belongs on the SVG page. HEIC is the notable refusal: it is what an iPhone saves by default and no browser can decode it, so encoding one would only produce a URI that renders nowhere. TIFF, PDF, and raw camera files are the same story. Convert them to PNG or JPEG first and encode the result.
The tool says my file is a different format from its extension. Which is right?+
The bytes are. Extensions are a naming convention that anyone can change, and files get renamed constantly: a PNG screenshot saved as .jpg, a WebP downloaded with a .png suffix. Every image format begins with a fixed signature, so the header is authoritative and it is what this page uses. If you write the extension's media type into the URI instead, browsers disagree about whether to sniff the content or trust the declaration, which is how an image ends up rendering on your machine and not on someone else's.
Can I use a data URI in an email, or as a favicon?+
As a favicon, yes: <link rel="icon" href="data:image/png;base64,…"> works in every current browser and saves a request on first paint. Email is the opposite: Outlook ignores data URIs outright and Gmail strips them, so embedded images in email still need a CID attachment or a hosted URL. Also worth knowing: browsers have blocked top-level navigation to data: URLs since 2017, so pasting one into the address bar to check it will not work. Use the preview above instead.
Is there a length limit on the URI itself?+
Not a meaningful one in modern browsers: a data URI of several megabytes will load from a stylesheet or an image tag. The limits that bite are practical. This page caps input at 10 MB because the encoded string has to live in the tab's memory and in the DOM. Beyond that, minified bundles and source maps become unreadable, some CMS and database fields silently truncate long values, DevTools grinds when you inspect the element, and every kilobyte is re-sent with the file it lives in.