XML URL Encode/Decode
URL encode XML or decode URL-encoded XML
XML Input
URL Encoded Output
Paste your XML on the left and the result shows up here.
Or drop a file on this box, , or .
What is XML URL Encode/Decode?
Sometimes XML has to travel inside a URL: a SAML redirect, a callback parameter, a form field. Characters like <, & and spaces would break the URL, so they are percent-encoded. This page does both directions: pick Encode to turn XML into a URL-safe string, or Decode to turn an encoded string back into XML.
Encoding uses the browser's encodeURIComponent and then also escapes ! ' ( ) *, so only the unreserved characters of RFC 3986 (letters, digits and - . _ ~) are left as they are. Text is encoded as UTF-8 first. Decoding accepts both %20 and the form-style + for spaces, and if the result is well-formed XML it is indented for reading, with text and CDATA left untouched.
The conversion is plain JavaScript running in this tab, so pasting a SAML request here does not send it anywhere. Watch the length, though: every bracket, quote and space turns into a three-character escape, so the encoded string ends up noticeably longer than the XML, and many servers reject request lines past roughly 8 KB. Large documents belong in a POST body, not a query string.
How to Use XML URL Encode/Decode
One page, two directions. The Encode / Decode toggle in the input header decides whether the right pane shows percent-encoded text or readable XML, and everything else stays the same.
Paste, Upload, or Load Sample
Paste XML into the left panel (or an encoded string when decoding), or click Upload to load a file. Sample loads a small order. Example:
<order id="ORD-7731"><customer>Ava Chen</customer><note>Gate code & buzzer</note></order> Use Clear to start fresh.
Choose Encode or Decode
Click the Encode / Decode toggle to switch modes. In encode mode < becomes %3C and a space becomes %20. In decode mode the encoded text becomes XML again. The right panel updates as you type.
Download or Copy
Click Download to save the result (a .txt when encoding, a .xml when decoding), or Copy to put it on your clipboard.
When You'd Actually Use This
API Query Parameters
Pass a small XML fragment as a query parameter, for example a SAML request in a redirect URL or a filter definition for a reporting endpoint.
HTTP Requests
Build an application/x-www-form-urlencoded body by hand when a legacy endpoint expects an XML document in a form field.
Web Forms
Check what an HTML form will send when one of its fields contains XML, or decode a captured form submission to read it.
Data Transmission
Encode or decode XML during data transmission. Ensure XML is properly formatted for different systems or protocols. Perfect for system integrations.
Common Questions
Is my XML uploaded?
No. The page calls the browser's own encodeURIComponent and decodeURIComponent, and a file you open with Upload is read through FileReader, so nothing travels over the network.
What is URL encoding?
Percent-encoding replaces each byte that is not safe in a URL with % plus two hex digits: a space becomes %20, < becomes %3C. MDN's percent-encoding page has a good table.
Why are ! ' ( ) and * encoded too?
RFC 3986 reserves them, and some servers treat them specially. JavaScript's encodeURIComponent leaves them alone, so this page escapes them as well to be safe. Any decoder reads both forms the same way.
Does decoding handle "+" for spaces?
Yes. Form submissions write a space as +, so a + in the input is decoded as a space. A real plus sign is always encoded as %2B, so nothing is lost.
Can I encode and decode multiple times?
Yes, but encoding an already-encoded string double-encodes it (%3C becomes %253C). If the decoded output still contains % sequences, decode it once more.
Is URL encoding secure?
No. It is an encoding, not encryption, and anyone can decode it. Do not put secrets in URLs, which end up in logs and browser history.
Other XML Tools You Might Need
Once a string decodes, you usually want to read or reshape the XML inside it. These tools pick up from there, and XML to Base64 is the other common way to squeeze a document into a URL or a header: