Encode a file
Choose a file to get its data URI.
Decode a data URI
Paste a data URI to download it as a file.
Data URI output
Choose a file to encode it.
Turn any file into a data URI (base64) for embedding in code, or decode a data URI back to a file. Free, instant.
Choose a file to get its data URI.
Paste a data URI to download it as a file.
Choose a file to encode it.
The browser's FileReader reads your file and returns a data URI: the MIME type, a base64 marker, and the base64-encoded bytes. That string can be pasted directly into an img src, a CSS url(), or any API that accepts inline data. Decoding reverses the process back into a downloadable file.
Base64 inflates data by about one third, so data URIs suit small assets like icons and tiny images. Large files bloat your HTML and block rendering; keep those as separate files and link them normally.