Data URI ↔ File
Convert any file to a Base64 Data URI, or decode a Data URI back to a downloadable file.
Click or drag any file to encode
Images, PDFs, fonts, text files…
About this tool
A data URI (Uniform Resource Identifier) encodes file content directly within a URI string using the format data:[mediatype][;base64],[data]. This allows any file to be referenced as if it were an external resource without requiring a separate file or network request. The MIME type (e.g., image/png, application/pdf, font/woff2) tells the browser how to interpret the embedded data.
Any file type can be represented as a data URI. Images, fonts, audio files, PDFs, and even JavaScript and CSS can be embedded this way. SVG files can be embedded either as Base64 or as URL-encoded plain text (without the base64 qualifier), since SVG is XML and consists of printable characters. URL-encoded SVG data URIs are slightly smaller than Base64-encoded ones for simple graphics.
Converting a data URI back to a file is useful when extracting assets embedded in HTML or CSS source code, debugging embedded resources in a network capture, or recovering assets from a single-file HTML document. The reverse process strips the data: prefix and MIME type, Base64-decodes the remaining data, and writes the result to a file with the appropriate extension.