XML URL Encode

Check that XML is well-formed, then percent-encode it for a URL.

Local Your input is processed locally in your browser. Found a problem? Report an issue

What XML URL Encode does

Check that XML is well-formed, then percent-encode it for a URL.

XML URL Encode examples

The built-in sample

Input

<users><user id="1"><name>Ada</name></user><user id="2"><name>Lin</name></user></users>

Output

%3Cusers%3E%3Cuser%20id%3D%221%22%3E%3Cname%3EAda%3C%2Fname%3E%3C%2Fuser%3E%3Cuser%20id%3D%222%22%3E%3Cname%3ELin%3C%2Fname%3E%3C%2Fuser%3E%3C%2Fusers%3E

This is the input that the Load sample button fills in.

Leading and trailing whitespace is trimmed

Input

  <a b="1">x y</a>  

Output

%3Ca%20b%3D%221%22%3Ex%20y%3C%2Fa%3E

The spaces around the document are dropped. Everything inside it, including the space in the text, is encoded as written.

Each output was produced by running this tool on the input above it.

How it works

The input is first checked as XML; invalid input is reported instead of being encoded. The text is percent-encoded with the same rules as URL Encode: everything except letters, digits and - _ . ! ~ * ' ( ) becomes %XX.

Details and limits

  • The document is checked for well-formedness but encoded as written: indentation and line breaks inside it are encoded too. Run XML Minify first for a shorter value.
  • Quotes around attribute values become %22 and angle brackets %3C and %3E.
  • Input that is not valid XML stops the tool, and the status line shows where the problem is. The XML Validator page lists the usual causes.

Questions

Is my data uploaded when I use XML URL Encode?

No. The tool runs in your browser, so what you paste or open is processed on your own device and is not sent to a server.

What does XML URL Encode do?

Check that XML is well-formed, then percent-encode it for a URL.

How does XML URL Encode work?

The input is first checked as XML; invalid input is reported instead of being encoded. The text is percent-encoded with the same rules as URL Encode: everything except letters, digits and - _.! ~ * ' () becomes %XX.

Are there any limits I should know about?

The document is checked for well-formedness but encoded as written: indentation and line breaks inside it are encoded too. Run XML Minify first for a shorter value. Quotes around attribute values become %22 and angle brackets %3C and %3E.

Is there a size limit?

There is no fixed size limit. Everything happens on your device, so very large inputs depend on its memory and can take longer on a phone than on a computer.

Does it work on phones, and is it free?

Yes. It works in any current browser on Android phones, iPhones, tablets and computers. It is free and needs no account or sign-up.