XML unescape tool

Useful for reading XML or HTML that arrived escaped inside an API message or a log.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter escaped text.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

In one pass the five standard entities &lt; &gt; &amp; &quot; &apos; and numeric references &#N; (decimal) and &#xH; (hex) are replaced by their characters. One pass means &amp;lt; becomes &lt;, not <. Unknown entities and references to disallowed characters are left as they are.

Example

Result: Unescaped text: <name>سارة & أحمد</name>; Entities decoded: 13; Entities left unchanged: 0.

&lt;name&gt;&#1587;&#1575;&#1585;&#1577; &amp; &#x623;&#x62D;&#x645;&#x62F;&lt;/name&gt;
<name>سارة & أحمد</name>

Limits and caveats

  • HTML entities such as &nbsp; and &copy; are not part of XML, so they stay as they are.
  • Only one level is decoded, text escaped twice needs a second run.

Questions about this tool

Why did &nbsp; stay unchanged?

XML defines only five named entities and &nbsp; belongs to HTML. Use the numeric reference &#160; instead.

What does &#1587; mean?

It is a decimal reference to Unicode code point 1587, the Arabic letter seen. &#x633; is the same number in hexadecimal.

Why did &amp;lt; not become <?

Decoding runs once, as an XML parser does, so &amp;lt; becomes &lt;. Run the tool again if the text was escaped twice.