Skip to content
OnlineToolStudio

XML Escape / Unescape

runs in your browserno sign-upfree

Escape text for XML (& < > " ') into entities, or unescape XML entities back to text.

Escaped

51 chars

About this tool

This tool escapes text for XML: & becomes &amp;, < becomes &lt;, > becomes &gt;, and optionally " and ' become &quot; and &apos; for use inside attribute values. Unescape turns these entities, and numeric ones like &#233; or &#xE9;, back into normal text.

How to use

  1. Choose Escape or Unescape.
  2. Paste your text or XML.
  3. Copy the result.

FAQ

Which characters must be escaped in XML?

Always & and < (they start entities and tags). > is escaped for safety. Inside attribute values, the quote character around the value must be escaped too — leave "Escape quotes" on to be safe.

Why does &nbsp; give an error?

XML only defines five named entities: &amp; &lt; &gt; &quot; and &apos;. Names like &nbsp; or &copy; come from HTML. Use the HTML Entity Encoder for those, or a numeric entity such as &#160;.

How do I use Swap?

Swap moves the result into the input box and switches between Escape and Unescape, so you can check the round trip.

Is my text uploaded?

No. Escaping runs entirely in your browser, so your text never leaves your device.

Related tools

All tools