XML URL Encode/Decode
URL encode XML or decode URL-encoded XML instantly
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:
URL-encoded output:
Use Sample above to load more example data.
What Is XML URL Encode/Decode?
URL encoding (percent-encoding) converts characters to %XX form so they can be safely used in URLs, query strings, or form data. Spaces become %20, angle brackets become %3C and %3E, and so on. The RFC 3986 standard defines how URIs are structured. Decoding reverses the process, turning %XX sequences back into the original characters.
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
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.
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.
Copy or Download
Use <strong>Copy</strong> to put the result on your clipboard, or <strong>Download</strong> to save it. For XML entity escaping (e.g. <code>&lt;</code>), 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 encode vs XML escape?
URL encoding uses %XX for use in URLs and query strings. XML escaping uses entities like <, & for use inside XML text content. Different contexts—use URL encoding for URLs, XML escaping for XML markup.
What characters get encoded?
Alphanumeric and a few safe characters (e.g. -, ., _, ~) stay as-is. Spaces, punctuation, angle brackets, ampersands, and other special characters become %XX hex sequences per RFC 3986.
Is my data private?
Yes. Processing runs entirely in your browser. No data is sent to any server. You can verify this in your browser's Network tab.
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.