#491 · Developer Tool

Data URI Parser

Break a Data URI into its media type, parameters, transfer mode, and decoded payload. The parser handles both percent-encoded text and base64 data, reports malformed escapes clearly, and never loads the embedded resource. Use it when reviewing inline images, generated download links, CSS assets, or API responses that carry a data: value.

Developer Input

Data URI Parser
Ad space

How to use this developer tool

  1. Paste the complete URI beginning with data:.
  2. Run the parser to validate its metadata and payload separator.
  3. Review the decoded output, media type, parameters, and byte count.
  4. Copy or download the payload only after checking whether the content is safe.

What this developer tool does

The output box contains the decoded payload. Text is shown as UTF-8 where possible; binary bytes are represented by a hexadecimal dump so they are not silently corrupted.

Split at the first comma, parse semicolon-delimited metadata, then decode the payload as base64 or percent-encoded bytes.

Parsing does not sanitize HTML, SVG, JavaScript, or other active content.

Example

Input: data:text/plain;charset=utf-8,Hello%20world
Output: Hello world

Use cases

  • Inspect inline CSS and HTML assets.
  • Recover short text embedded in API data.
  • Check media types before saving generated content.

Tips for reliable output

  • Keep the data: prefix.
  • Do not replace plus signs with spaces.
  • Use upload when the URI is very long.
  • Treat decoded active content as untrusted.

Processing details

The first comma is the metadata/payload boundary. A final metadata token named base64 selects base64 transfer decoding; other parameters are reported as name/value pairs.

Large Data URIs consume browser memory. Charset conversion is limited to UTF-8 display; unknown binary content is returned as hex.

Frequently asked questions

Can a Data URI contain binary data?

Yes. Binary payloads normally use the base64 marker; percent-encoded payloads are better suited to short text.

Does parsing a Data URI fetch anything from the network?

No. The parser reads the URI text locally and does not request the embedded resource.

Why does percent decoding sometimes fail?

A stray percent sign or a non-hex escape makes the payload malformed. Correct the escape sequence before parsing.

Is the media type required in a Data URI?

No. When omitted, the specification defaults to text/plain with US-ASCII semantics.

Can I use the parsed payload directly in HTML?

Treat decoded content as untrusted input. Review it before inserting it into a document or executing it.

Output fields

FieldMeaning
SummaryHigh-level processing result
StatisticsCounts and validation details
ExportCopy-ready text plus structured data when available