Text to unescape

Unescaped text

Why unescape XML text?

Unescaping XML is useful when you have XML-escaped text that you want to convert back to its original form with proper special characters. This is often needed when working with data from XML parsers, APIs, or when displaying XML content to users in a readable format.

Examples of XML unescaping

Escaped text

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <element attribute="value">
    <child>Text with special chars: & < > ' "</child>
    <data>CDATA sections like <![CDATA[ < > & ]]> don't need escaping</data>
  </element>
  <items>
    <item id="1">First item</item>
    <item id="2">Second & third</item>
  </items>
</root>

Unescaped text

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <element attribute="value">
    <child>Text with special chars: & < > ' "</child>
    <data>CDATA sections like <![CDATA[ < > & ]]> don't need escaping</data>
  </element>
  <items>
    <item id="1">First item</item>
    <item id="2">Second & third</item>
  </items>
</root>

XML Predefined Entities that get unescaped

EntityCharacterDescription
&amp;&Ampersand
&lt;<Less than
&gt;>Greater than
&quot;"Double quote
&apos;'Apostrophe (single quote)

When to use XML unescaping

  • When processing XML data that has been escaped for storage or transmission
  • When displaying XML content to users in a readable format
  • When extracting text content from XML documents
  • When debugging XML strings to see the actual content
  • When converting XML-escaped text back to its original form for editing

Important notes about XML unescaping

  • The unescaping process converts XML entities back to their original characters
  • The order of unescaping matters - &amp;lt; should become < (not &lt;)
  • This tool unescapes in the correct order: first &apos; and &quot;, then &gt; and &lt;, and finally &amp;
  • XML numeric character references (like &#39; or &#x27;) are not handled by this tool

This tool is useful for converting escaped XML text back to its readable form, which can be helpful when analyzing XML data, debugging, or preparing XML content for display.

Other tools

Other tools available on this website: