Encode an XML fragment so it can sit safely in a URL.
Loading the tool...
How to use XML URL Encode
Paste your XML.
If it has an error, you see where and can fix it first.
Copy the encoded string and put it after the parameter name, for example ?data=.
About XML URL Encode
Older web services and some payment or redirect flows pass an XML message inside a URL parameter, often together with a signature.
Braces, quotes, colons and spaces are all special in a URL, so the text has to be percent-encoded before it goes into a query string. The XML is checked and its whitespace between tags is removed before encoding.
Frequently asked questions
How long can a URL be?
Browsers allow very long addresses, but servers and proxies often cut them at 2,000 to 8,000 characters. For anything larger, send the XML in a request body instead.
Is it safe to put sensitive data in a URL?
No. URLs end up in browser history, server logs and referrer headers. Encoding is not encryption, so keep secrets out of the address.
How do I decode it again?
Use the XML URL Decode tool, which reverses the encoding and the XML is indented so you can read it.
Why is the output so much longer than the input?
Each special character becomes three characters, for example { turns into %7B. Structured text is full of special characters, so growth of 50 percent or more is normal.