How this tool computes its result
Converts an uploaded file to a Data URI using the browser's native FileReader.readAsDataURL (which handles base64 encoding and MIME-type detection automatically). In the reverse direction, it parses a pasted Data URI, checks for a ';base64' marker in the metadata segment via regex, and either decodes the base64 payload into a Uint8Array with atob() or, for non-base64 URIs, runs decodeURIComponent on the raw payload — either way wrapping the bytes in a Blob using the MIME type extracted from the 'data:<mime>' prefix, then triggering a browser download named by that MIME subtype.
