XML URL Encode
Percent-encode XML so it's safe in a URL or query string. It runs entirely on your device — nothing is uploaded.
Reviewed by the CalcCafe editorial team · Last updated 1 July 2026 · How we test our tools
Example
<a b="1"/>
%3Ca%20b%3D%221%22%2F%3E
How it works
Standard percent-encoding makes characters like <, > and spaces URL-safe.
Good to know
XML URL Encode takes a chunk of XML and percent-encodes every character that has a special meaning in a URL, turning markup like <a b="1"/> into %3Ca%20b%3D%221%22%2F%3E. It is built for developers and API testers who need to drop raw XML into a query string, a redirect parameter, a form field, or a config value without the angle brackets, quotes, equals signs, and spaces breaking the link.
Reach for it whenever XML has to travel inside a URL: passing a SOAP or RSS snippet as a GET parameter, embedding markup in a webhook callback URL, encoding XML for an OAuth or signing step, or pasting a payload into a browser address bar for a quick test. Characters such as <, >, &, =, ", #, ?, and the space are exactly the ones that confuse URL parsers, so encoding them first keeps the request intact.
Reading the output is straightforward: each unsafe byte becomes a percent sign followed by two hexadecimal digits (for example %20 is a space and %3C is <), while letters, digits, and a few safe symbols pass through unchanged. To recover the original XML, run the encoded string through a matching URL-decode step, after which it should be byte-for-byte identical.
A practical caveat: URL-encoding is about transport safety, not XML well-formedness, so it does not validate or fix your markup, and the same encoded text can decode differently depending on whether + is treated as a space. If your XML contains accented or non-Latin characters, make sure it is UTF-8 before encoding so the percent-escapes round-trip correctly on the receiving end.
Frequently asked questions
Is my data uploaded anywhere?
Is this tool free?
People also ask
What is the difference between XML URL encoding and XML escaping?
How do I decode percent-encoded XML back to its original form?
Does URL encoding change the meaning of my XML?
Why does a space sometimes become %20 and sometimes a plus sign?
Do I need to URL-encode XML before putting it in a query string?
Will this tool validate that my XML is well-formed?
Is it safe to URL-encode XML that contains non-English characters?
Related tools
Sources & references
These tools follow our methodology and provide educational estimates only — verify important figures with a qualified professional.