FormatterHQ

XML URL Decode

Decode percent-encoded XML from a URL, form body or log file back into readable markup, with the output shown as highlighted XML.

Loading tool…
Ready.

How to use the XML URL Decode

  1. Type or paste into the URL encoded box, or click Sample. You can also drop a text file on either box, or load one into the URL encoded box with its Open file button.
  2. The XML box updates live as you type. It works both ways — edit the XML side to convert back, or click ⇄ Swap to exchange the sides.
  3. Use Copy or Download on either box to take the result, or Clear to start again.

XML URL decode: read encoded markup

Web server logs, proxy traces and browser developer tools show XML parameters in their encoded form: %3Corder%20id%3D%227%22%3E…. The XML URL decode tool percent-decodes the value and displays the result as XML, so you can read the request that was actually sent.

Example

Encoded input:

%3Corder%20id%3D%227%22%3E%3Citem%20qty%3D%222%22%3ETea%20%26amp%3B%20biscuits%3C%2Fitem%3E%3C%2Forder%3E

Decoded XML:

<order id="7"><item qty="2">Tea &amp; biscuits</item></order>

Only the URL layer is removed. XML entities such as &amp; stay in place, because they are part of the XML itself and an XML parser will decode them when it reads the document. If you want the entities decoded too, run the result through XML Unescape.

How decoding works

  • Each %XX sequence becomes the corresponding byte, and multi-byte UTF-8 sequences are combined into characters.
  • A + is kept as a plus sign. If the XML was posted from an HTML form, spaces may appear as +; decode it with the URL Decoder and its “Decode + as space” option instead.
  • Invalid percent sequences are left as they are rather than stopping the whole decode.

Recognizing encoded XML at a glance

A handful of escape sequences make up most of an encoded XML value. Learning them lets you read a log line without decoding it:

EncodedCharacterEncodedCharacter
%3C<%3E>
%2F/%3D=
%22"%26&
%20space%0Aline feed

So %3C%3Fxml is the start of an XML declaration, and %3C%2F marks a closing tag. A value starting with %253C has been encoded twice, because %25 is the percent sign itself.

Troubleshooting

  • Output looks like random letters and digits. The value is probably Base64, as in SAML SAMLResponse form posts. Decode it with Base64 to XML after URL decoding.
  • Garbled binary output. SAML redirect-binding requests are DEFLATE-compressed before Base64 encoding, so they need to be inflated as well.
  • Still contains %3C. The XML was encoded twice. Decode again.

Decoding XML parameters in code

In PHP, rawurldecode keeps plus signs while urldecode turns them into spaces; in Java, URLDecoder.decode always converts + to a space. That matters for XML, because a literal plus inside element text or an attribute — a phone number such as +44 20 7946 0000, for example — is silently changed into a space if the sender did not encode it as %2B. If numbers or formulas look wrong after decoding, check how the plus sign was handled.

Next steps

Once decoded, you can copy the XML into a formatter or validator to check its structure, compare it with the payload your code intended to send, or extract a single element value for a bug report. Because the decoding happens in your browser, it is fine to use with internal integration payloads.

Frequently asked questions

Why are &amp; entities still in the output?
They belong to the XML, not to the URL encoding. An XML parser decodes them when reading the document. Use XML Unescape if you want plain text.
Can this decode a SAMLResponse?
A SAMLResponse is Base64 encoded, not just percent-encoded. URL-decode it first if needed, then decode the Base64 to get the XML.
Does it validate the XML?
No. It decodes the text and shows it with XML highlighting. Use an XML validator to check that the document is well-formed.
What if spaces show up as + signs?
Form-encoded data uses + for spaces. Decode it with the general URL Decoder with “Decode + as space” enabled.

Last updated October 3, 2026

Related tools