About
Tool No. 98 of Pikkola, 28 November 2026
Text, a file or an SVG becomes one URL in base64 or in the shorter percent-encoded form, with the size change shown against the original. A pasted URI comes back as bytes, with the media type read from the URI itself.
What it does
- Encodes any bytes as base64 and text as a percent-encoded data URI
- Minifies an SVG by removing the declaration, the doctype, comments and inter-element whitespace
- Shows the size change against the source as a signed percentage
- Decodes a pasted URI back to bytes, previews an image and offers the file as a download
The request that is not there
An inlined icon makes no request: no DNS, no connection, no cache entry that can go stale. That is why icon sets are the place the technique is used, and why a data URI in a stylesheet is a transport decision rather than a design one.
Base64 costs a third, and the cache
Three bytes become four characters, so the URI is roughly 37 per cent longer than the file before the media type. It also cannot be cached apart from the document that carries it, so an asset used on every page is usually better as a real file with a long cache header.
Percent-encoding cannot carry binary
An SVG is text, and a URL leaves most of its characters alone, so a minified SVG often shrinks in percent form. The same trick on a PNG does not work: bytes that are not valid UTF-8 do not survive the trip, which is why the encoder refuses percent for anything that is not text.
What it is not
It does not host anything, does not sniff a media type from the bytes and does not repair a damaged URI. A data URI is also not a safe carrier for a script or a page: this page decodes one to inspect it, and does not put it back into a document.
Contact
A URI this page misreads, or an encoding detail worth documenting: hello@pikkola.com.