Data URI Encoder & Decoder
About Data URI Encoder / Decoder
Data URI Encoder / Decoder creates self-contained data: URLs from UTF-8 text and recovers text or exact binary bytes from existing Data URIs.
How it works
Base64 or percent encoding
Base64 is compact for binary and non-ASCII content, while percent encoding keeps simple text more readable. Textual MIME types receive an explicit UTF-8 charset when encoded.
Strict payload decoding
The media type, parameters and Base64 marker are parsed separately. Invalid Base64 alphabets, padding shapes and incomplete percent escapes are rejected instead of being silently repaired.
Text preview or binary download
Valid UTF-8 bytes appear as decoded text. Other bytes receive a safe summary, canonical Base64 copy value and a downloadable file named from the recognized MIME type.
Frequently asked questions
What is the default MIME type when none is present?
The Data URI specification defaults to text/plain. The decoder reports that type when the media type is omitted.
Which encoding should I choose?
Use percent encoding for short readable text and Base64 for binary or heavily escaped content. Base64 increases raw size by roughly one third.
Can Data URIs be very large?
Browsers and consuming applications impose different URL limits. For large assets, ordinary files or blob URLs are usually more appropriate.
Sources & last verified
The behaviour of this tool and the claims on this page were checked against the specifications below on . Everything runs in your browser, so the output you see is exactly what the engine produced.
Found a wrong result or an outdated claim? Report an error and it will be re-verified.