XML Input

URL Encoded Output

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.

Everything happens in your browser; your XML never leaves your computer. Keep URL length limits in mind: browsers and servers usually cap URLs at a few thousand characters, so large documents belong in a POST body, not a query string.

How to Use XML URL Encode/Decode

Follow these steps to URL encode or decode your XML. Each step uses the actual buttons and panels on this page.

1

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:

2

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.

3

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. Encoding and decoding happen in your browser; your XML never leaves your computer.

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

Encoding is just one XML task. Here are other tools that work well together: