How a data URL is built
The output has the form data:<mime>;base64,<payload> — for example data:image/png;base64,iVBORw0KG.... The MIME type tells the browser how to decode the bytes, and the Base64 payload is the binary image re-encoded as text. Because Base64 uses 4 characters per 3 bytes, the encoded string is about 33% larger than the original file.