Overview
Introduction
Once XML has been percent-encoded to travel safely through a URL, you eventually need to see it in its original, readable form. This tool decodes that value and immediately validates and formats the result as XML, in one step.
It's the natural counterpart to the XML URL Encoder, and useful any time you're handed a URL-encoded string that's supposed to contain XML and need to confirm what's actually inside it.
What Is XML URL Decoder?
A URL decoder specifically for XML: it decodes a percent-encoded string back to plain text using decodeURIComponent, then parses and pretty-prints that text as XML using this category's shared parser and formatter.
Decoding and XML validation happen as two distinct, clearly reported steps, so a failure at either stage tells you exactly what went wrong instead of a single opaque error.
How XML URL Decoder Works
The input is decoded with JavaScript's built-in decodeURIComponent, which reverses %XX percent-encoded sequences back to their original characters.
The resulting text is parsed with the same well-formedness checker used by the XML Validator; on success, the result is re-serialized with standard indentation via the same formatter behind the XML Prettifier.
When To Use XML URL Decoder
Use it when you've captured a percent-encoded value from a URL, a log line, or a network request and need to see the XML it actually represents.
It's also useful for verifying that an XML URL Encoder round trip produced the document you expected.
Often used alongside XML URL Encoder, Base64 to XML Converter and XML Validator.
Features
Advantages
- Runs entirely client-side, so decoded content with real configuration data never leaves your browser.
- Reports decoding failures and XML syntax errors as two distinct, clearly labeled steps.
- Automatically pretty-prints the decoded document, useful when the original was encoded in compact, single-line form.
- Uses the same decoding behavior browsers use for query string values, so results match what a real request received.
Limitations
- Only checks well-formedness of the decoded text, not conformance to a specific XSD or DTD schema.
- Assumes the encoded value represents text encoded with encodeURIComponent-compatible percent-encoding; other encoding schemes may not decode correctly.
- Very large inputs (tens of megabytes) may be slow, since decoding and parsing both hold the full content in memory.
Examples
Best Practices & Notes
Best Practices
- Check whether a decode failure is about the percent-encoding itself or the XML inside it, the error message distinguishes the two.
- Pair with the XML URL Encoder to confirm a full round trip preserves your intended document.
- Copy the encoded value exactly as it appears in the URL or log, partial copies often truncate a %XX sequence.
Developer Notes
`urlDecodeXml` (in this category's `lib/url-decode-xml.ts`) decodes with `decodeURIComponent`, catching the `URIError` it throws on a malformed percent-encoding sequence and converting it into this category's standard error shape. The decoded text is then parsed with `parseXmlDocument` and re-serialized with `toPrettyXml`, both from `xml-core.ts`.
XML URL Decoder Use Cases
- Inspecting the actual XML content behind a URL query parameter or redirect link
- Verifying a full encode/decode round trip through the XML URL Encoder
- Decoding an XML payload captured from a browser network tab or server access log
- Debugging a webhook or API integration that passes XML through a URL
Common Mistakes
- Copying a partial percent-encoded string that truncates a %XX sequence mid-way.
- Assuming a decode success guarantees valid XML, decoding and XML well-formedness are checked separately.
- Expecting a value encoded with a different scheme (like Base64) to decode correctly here; this tool expects percent-encoding.
Tips
- Use the reported error to tell whether the problem is the percent-encoding or the decoded XML's syntax.
- Pair with the XML URL Encoder to check what a round trip does to your specific document.
- Expect the output to always be pretty-printed, even if the original document was compact before encoding.