XML Escape/Unescape
Free online XML special character escaper tool
What is XML Escaping?
XML escaping replaces special characters with escape sequences so they do not interfere with XML markup. The five predefined XML entities are: < (<), > (>), & (&), " ("), and ' ('). Escaping is necessary whenever text content contains these characters.
How to Escape or Unescape XML
Paste your text or XML content in the input area. Click Escape to convert special characters into XML entities. Click Unescape to reverse the process. The tool handles all five predefined XML entities and ensures well-formed XML output.
▶Which characters must be escaped in XML?
The ampersand (&) must always be escaped as &. In attribute values, quotes must be escaped. Less-than (<) must be escaped as < in text content. Greater-than (>) is recommended to escape as >.
▶Is XML escaping the same as HTML entity encoding?
They share the same five predefined entities (< > & " '), but HTML has many more named entities (like ©) that are not predefined in XML.
▶Can I use CDATA instead of escaping?
Yes. Wrapping text in <![CDATA[...]]> sections lets you include special characters without escaping. CDATA sections cannot contain the sequence ]]>.