Skip to content

XML URL decoding

Paste URL-encoded XML and get clean, readable XML back, indented and checked. It turns %3C back into <, undoes XML that was encoded several times, and unescapes < entities too.

%3C → < · %3E → > · %2F → / · %22 → " · %20 → space

XML
<note priority="high"><to>Team</to><body>Review the XML payload</body></note>

Decoded · 121 characters → 77 characters

Everything runs in your browser; nothing is uploaded.

How XML URL decoding works

URL encoding (percent-encoding) replaces the brackets, slashes, quotes and spaces in XML with a % and two hex digits, so the XML can travel inside a URL. Decoding reverses it:

  1. Each percent sequence is turned back into its character: %3C into <, %3E into >, %22 into ".
  2. Spaces come back from %20, or from + if the XML came from a form or a query string.
  3. Characters that took several bytes, such as %C3%A9, are put back together into one character (é).

Once every reserved symbol is restored you have a normal XML document again. The tool then checks that it is well-formed and indents it so it is easy to read.

Percent codes in encoded XML

These are the codes you will see most in URL-encoded XML, and what each one decodes to:

Common percent codes in URL-encoded XML
CodeDecodes toCodeDecodes to
%3C<%20 or +space
%3E>%0Aline break
%2F/%3F?
%22"%3A:
%3D=%23#
%26&%25%
%27'%C3%A9é

Upper and lower case mean the same thing, so %3c is also <. If you see %25 followed by more digits, such as %253C, the XML was encoded twice; see below.

Worked example: %3Cp%3EHello%20%26amp%3B%20World%3C%2Fp%3E

Step 1: Decode the tags

%3Cp%3E → <p>  ·  %3C%2Fp%3E → </p>

Step 2: Decode the spaces and the ampersand

%20 → space  ·  %26amp%3B → &amp;

Step 3: Read the result

<p>Hello &amp; World</p>

Result: <p>Hello &amp; World</p>. The &amp; is correct: inside XML an ampersand has to be written that way, and any XML reader shows it as “Hello & World”. If you want the plain text without entities, unescape it with the XML escape tool.

Decoding XML that was encoded more than once

XML that passes through redirects, proxies or several systems is often URL-encoded again at each step. Every extra layer encodes the % signs of the one before as %25:

The same XML encoded one, two and three times
LayersWhat you see
0 (the XML)<note/>
1%3Cnote%2F%3E
2%253Cnote%252F%253E
3%25253Cnote%25252F%25253E

The tool keeps decoding until real tags appear, up to 16 layers, and says in the status line how many it undid. It also handles the other common mix-up: XML that was escaped as &lt;note&gt; before being URL-encoded comes out as normal <note> tags.

Decoding XML URLs in Python, JavaScript, PHP, Java and C#

urllib.parse.unquote(encoded)                    # Python (unquote_plus if + means space)
decodeURIComponent(encoded)                       // JavaScript
urldecode($encoded);                              // PHP (+ becomes a space)
URLDecoder.decode(encoded, "UTF-8");              // Java (+ becomes a space)
Uri.UnescapeDataString(encoded);                  // C#

JavaScript’s decodeURIComponent leaves + as it is, so for form data replace it first: decodeURIComponent(s.replace(/\+/g, ' ')). Each function undoes one layer; call it again if the result still contains %3C.

Frequently asked questions

How do I decode a URL?

Replace each % code with the character it stands for: %20 is a space, %3C is <, %2F is /. Paste the URL or the encoded part into the tool above and it does this for you, or use decodeURIComponent() in JavaScript or urllib.parse.unquote() in Python.

Can you decrypt an XML file?

URL-encoded XML is not encrypted, just encoded, so anyone can decode it with the tool above. Truly encrypted XML, such as a file with EncryptedData elements, can only be read with the right key.

How do I get the XML code of a website?

Open the XML address directly in your browser, for example /sitemap.xml or an RSS feed, or press Ctrl+U (Cmd+Option+U on a Mac) to view the source. If the XML appears URL-encoded in a link, paste it here to decode it.

Is it safe to paste encoded XML here?

Yes. Decoding happens entirely in your browser; nothing is uploaded, and the tool never opens the URL.

Sources