XML URL Decoding
ED-39Paste URL-encoded XML and get indented XML back. You can also decode without formatting, or percent-encode XML so it can travel in a URL.
Runs in your browser. Nothing is uploaded.
URL-encoded XML, or XML for the encode action
Result
How to use it
- Paste the percent-encoded XML, for example %3Cnote%3E%3Cto%3EAda%3C%2Fto%3E%3C%2Fnote%3E.
- Choose the indent, and tick the plus option if + stands for a space.
- Click Decode and format.
- To go back, paste XML and click Encode XML.
Decoding and the XML check
Percent-encoding writes bytes as %XX, so %3C is < and %3E is >. The tool decodes the bytes as UTF-8 and then runs a basic check that tags open and close in the right order and that there is one root element, then prints the XML with the indent you choose. It is not validation against a schema or DTD, and entities such as & stay as written. Decode only gives the decoded text with no check.
Encoding XML for a URL
Encode XML percent-encodes every character except letters, digits and - _ . ! ~ * ' ( ), so the markup, quotes and spaces cannot break a query string. It trims whitespace at the ends of the text but does not minify or change the XML. The tool works with the text you paste and does not read a full URL or pick one parameter out of it, so remove the part before the value first.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Not valid percent-encoding | A % is not followed by two hex digits, or the decoded bytes are not UTF-8. | Encode a literal % as %25, or check where the text was cut. |
The decoded text is not well-formed XML | Decoding worked, but the tags do not match up. | Use Decode only to inspect the text, or try decoding twice. |
Questions people ask
How do I URL decode XML?
Paste the encoded text and click Decode and format. Each %XX sequence becomes its character, the tags are checked and the XML is printed with indentation. Decode only skips the check and the formatting.
What does %3C and %3E mean in XML?
%3C is the less-than sign < and %3E is the greater-than sign >, the characters that open and close an XML tag. %2F is the slash, so %3C%2Fnote%3E is the closing tag </note>.
Why does it say the XML is not well-formed?
After decoding, a tag was left open, closed in the wrong order, or the text had more than one root element. The message names the tag and line. The check is basic and does not validate against a schema.
Should a plus sign become a space?
Only in form-encoded data, such as a query string produced by an HTML form. Tick the option for that case. In other URL parts a plus is a literal plus, so it is kept by default.
Can I encode XML for a URL?
Yes, click Encode XML. All characters except letters, digits and a few symbols are percent-encoded, so the result can be used as a query parameter value without breaking the URL.
About this tool
Decoding reverses percent-encoding (%3C becomes <) as UTF-8, then checks that the tags are balanced and prints the XML with the indentation you pick. It is a basic well-formedness check, not validation against a schema or DTD. Entities such as & are left as they are. Decode only skips the check and formatting. A + is kept unless you tick the option. Encode XML percent-encodes all characters except letters, digits and - _ . ! ~ * ' ( ) and does not change the XML itself, so the result is safe to put in a query parameter.