What a data URL is
A data URL puts the contents of a file directly into the address: data:image/png;base64,iVBORw0…. Wherever a normal URL is accepted — an <img src>, a CSS url(), a font — a data URL works too, with no second request and no separate file to forget. The cost is size: Base64 makes binary data about 33% bigger, and the data cannot be cached separately.
The main use: single-file HTML pages
The most common reason a shared HTML page shows broken images is that the images lived next to the file on someone's computer. Converting small images, icons and logos to data URLs and pasting them into the HTML makes the page completely self-contained — it can be emailed, uploaded as one file, or pasted into an HTML code to URL converter with nothing missing. Keep it for small assets: a page full of multi-megabyte photos as data URLs gets slow; upload a folder with ZIP to URL instead.
Can a data:text/html URL replace hosting?
Not any more. A data:text/html URL used to open as a page when pasted into the address bar, which made it a cheap way to "share HTML as a URL". Chrome, Firefox and Safari now block top-level navigation to data URLs because phishers abused them, so a link like that does nothing when clicked. It still works inside an <iframe src> on a page you control — which is what the HTML snippet above produces — but to give someone a clickable link, the page has to be hosted. That is what the converter is for.
Size guide
- Icons and logos under ~10 KB: always fine as data URLs.
- Images 10–200 KB: fine for a handful; compress to WebP first.
- Anything over ~1 MB: host the file and link to it.