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?

If you have ever tried passing raw XML inside a URL query parameter, you know the pain: angle brackets, ampersands, and spaces break everything. 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. Everything runs locally in your browser — your XML never touches a server.

This tool encodes or decodes XML (or any text) for URL-safe use. JavaScript's encodeURIComponent and decodeURIComponent power the conversion. All processing runs in your browser; nothing is sent to a server.

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

Use Copy to put the result on your clipboard, or Download to save it. 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

What is the difference between URL encoding and XML escaping?

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?

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

Related Tools

For more on URL encoding, see MDN encodeURIComponent, MDN decodeURIComponent, and RFC 3986 (URI Generic Syntax). For URL handling in the browser, see MDN URL API. For XML, see the W3C XML specification and W3C XML. For form encoding, see URL Living Standard.