XML Input

URL Encoded Output

XML URL Encode Examples

XML is URL-encoded for safe use in query strings and URLs. Example:

XML input vs URL-encoded output

Input XML:

Input

URL-encoded output:

Output

Use Sample above to load more example data.

What Is XML URL Encode/Decode?

Raw XML inside a URL query parameter breaks at the first & or space, and some servers reject the angle brackets outright. RFC 3986 percent-encoding fixes that by converting unsafe characters to %XX form. This tool uses JavaScript's encodeURIComponent under the hood, following the W3C XML specification. The reverse direction calls decodeURIComponent. Both functions are built into the browser, so the XML you encode is handled on your own machine and never uploaded.

This tool encodes or decodes XML (or any text) for URL-safe use. JavaScript's encodeURIComponent and decodeURIComponent power the conversion, and since they ship with every browser there is no network round trip involved: a SOAP body or an XML payload you paste here stays in this tab.

How to Use This Tool

1

Choose Mode and Paste

Select Encode to convert XML (or any text) to URL-safe form, or Decode to convert percent-encoded text back. Paste into the left editor or upload a file. Use the toggle button to switch between modes.

2

View the Output

The right panel updates automatically. In Encode mode, special characters become %XX sequences. In Decode mode, those sequences become the original characters. Invalid percent-encoding may produce unexpected output.

3

Copy or Download

Copy grabs the percent-encoded string for your query parameter, and Download keeps a copy as a file. For XML entity escaping (e.g. <), use XML Escape. For validation, use XML Validator.

When URL Encoding Helps

When passing XML in a query parameter (e.g. ?payload=...), unencoded <, &, or spaces can break the URL or be misinterpreted. Encoding makes the value URL-safe. When receiving URL-encoded XML from an API or webhook, decoding restores the original XML for parsing. It's also useful when storing XML in a URL-safe format or debugging encoded payloads.

Frequently Asked Questions

URL encoding or XML escaping: which one do I need?

URL encoding converts characters to %XX sequences for safe use in URLs and query strings. XML escaping uses entity references like &lt; and &amp; for use inside XML documents. Use URL encoding when embedding XML in a URL; use XML Escape when embedding content inside XML markup.

Which characters does encodeURIComponent percent-encode?

Alphanumeric characters and a handful of unreserved symbols (-, _, ., ~) stay untouched. Everything else (spaces, angle brackets, ampersands, quotes) becomes %XX hex sequences per RFC 3986.

Is my XML data private?

Yes. All encoding and decoding runs entirely in your browser via JavaScript. No data ever leaves your machine. Open DevTools > Network tab to verify: zero requests.

Can I decode URL-encoded XML back to the original?

Yes. Toggle to Decode mode or visit our XML URL Decoder. The tool uses decodeURIComponent to reverse the encoding.

Related Tools

The encoder on this page is the browser's own encodeURIComponent, and the decode direction is decodeURIComponent; their MDN pages list exactly which characters are left alone. RFC 3986 explains why <, & and quotes must be percent-encoded inside a query string, and the WHATWG URL Standard covers the form-encoding rules where a space becomes + instead of %20. To build or pick apart a full URL in code, the URL API is the tool. The markup you are encoding is defined in XML 1.0, with the wider family of specs linked from the W3C XML home page.