How to Decode Data URIs
Data URI Decoding
When to Decode Data URIs
Inspect inline assets copied from HTML, CSS, or JSON configs. Extract MIME type and payload when debugging malformed data: URLs or verifying what a third-party snippet embeds.
Supported Formats
Handles data:[mime];base64,... and plain percent-encoded payloads. Output shows the declared MIME type and decoded text for Base64 segments.
Developer Tips
- Do not execute decoded HTML or scripts blindly — treat untrusted data URIs as untrusted input
- Binary image payloads may not display as readable text after decode
- Compare MIME type with actual content when investigating CSP or XSS reports
Frequently asked questions
Why did decoding fail?
The string may be missing the data: prefix, use an unsupported encoding, or contain invalid Base64 characters.
Are credentials in data URIs safe?
No. Anyone with the URI can decode the payload. Avoid embedding secrets in data URIs.