Have you ever pulled an XML snippet from an API and seen < where a < should be? The XML Unescape Tool fixes that. It turns XML entity codes back into the plain characters they stand for.
This tool is for developers, QA testers, and support staff who read XML logs, feeds, or API responses. You paste escaped text on the left, and the readable version appears on the right as you type.
Table of Contents
- What the Tool Does
- How to Use It, Step by Step
- How the Unescaping Works
- Worked Example
- How to Read the Results
- Which Entities It Handles
- Common Mistakes and Tips
- Limitations and Assumptions
- FAQs About the XML Unescape Tool
What the Tool Does
The tool reads one block of escaped XML text. It swaps known entity codes for their real characters. Everything runs in your browser, so nothing is uploaded.
- Unescaped XML Output: the decoded text, shown in a read-only box.
- Input Length: the character count of what you pasted.
- Unescaped Length: the character count of the decoded result.
- Entities Decoded: how many entity codes were replaced.
- Clear empties the input box, and Copy XML copies the output.
How to Use It, Step by Step
- Paste your escaped text into the Escaped XML Input box.
- Watch the Unescaped XML Output box fill in as you type.
- Check the three cards on top for input length, output length, and the decode count.
- Press Copy XML to place the decoded text on your clipboard.
- Press Clear to empty the input and start again.
How the Unescaping Works
The tool does a plain find and replace. It looks for the five named codes plus numeric and hex references. Each match becomes a single character.
&lt;=<,&gt;=>,&amp;=&
The five named codes are < for <, > for >, " for a double quote, ' for an apostrophe, and & for &. Numeric codes like < and hex codes like < also decode to their characters.
The ampersand code is handled last on purpose. That order stops a double decode. Text like &amp; becomes &, not a bare &.
Worked Example
Imagine Priya copies this line from an XML feed: <note id="7">Fish & Chips < $10</note>. She pastes it into the input box.
The input holds 67 characters. The tool finds eight entity codes and swaps each one.
| Entity | Count | Becomes |
| < | 3 | < |
| > | 2 | > |
| " | 2 | double quote |
| & | 1 | & |
The output reads <note id="7">Fish & Chips < $10</note>. The cards show Input Length 67, Unescaped Length 38 chars, and Entities Decoded 8.
How to Read the Results
Input Length counts every character you pasted, including spaces and line breaks. It does not count words.
Unescaped Length is usually smaller. Each entity code of several characters shrinks to one character after decoding.
Entities Decoded is the total number of swaps. If this stays at zero, your text had no codes the tool knows.
Which Entities It Handles
XML has five built-in entities, and this tool covers all of them. Those five are the only named entities the XML standard defines by itself.
Beyond those names, the tool reads numeric character references. A decimal code and its matching hex code both resolve to the same character. A reference that points outside the valid range stays as plain text.
If you need to go the other way and add entity codes, the XML escape converter does the reverse job. For web markup, the HTML entity decoder handles the larger HTML entity set.
Common Mistakes and Tips
Entity names are case sensitive in real XML. Only lowercase codes like < are valid, and the tool matches that. An uppercase code like < stays as plain text.
That is how a strict XML parser behaves. If a code does not decode, check its spelling and case first.
Once the text is clean, you may want to tidy its layout. The XML formatter adds indentation, and the XML validator checks the structure. To turn the result into another format, try the XML to JSON converter.
Limitations and Assumptions
- The tool decodes the five named XML entities plus all numeric and hex references. It does not resolve custom or DTD entities, or HTML-only codes like the one for copyright.
- Named codes must be lowercase, since XML names are case sensitive. A numeric code point outside the valid range is left unchanged.
- There is no size limit in the code, but very large pastes can slow your browser.
- Blank input gives a blank output with zero counts, and no error is shown.
- The Copy button uses the browser clipboard and falls back to an older copy method. If both fail, a visible message asks you to copy by hand.
- This tool only decodes text. It does not check whether the result is valid XML.
Need another utility? Browse the full developer tools hub for formatters, converters, and validators.
FAQs About the XML Unescape Tool
What does it mean to unescape XML?
Unescaping means turning entity codes back into the characters they represent. For example, the code for less-than becomes a real < sign.
Which XML entities does the tool decode?
It decodes the five named entities for less-than, greater-than, double quote, apostrophe, and ampersand. These five are the only names the XML standard defines.
Why is the ampersand code decoded last?
Decoding the ampersand last prevents a double decode. It keeps text like the code for an escaped ampersand correct instead of over-decoding it.
Does it handle numeric and hex codes?
Yes. A decimal reference and its matching hex reference both produce the same character. That lets you read feeds that mix named and numbered codes.
Is my text uploaded anywhere?
No. The decoding runs in your browser with JavaScript. Your text is not sent to a server or stored by the tool.
Will the output always be valid XML?
Not always. The tool decodes codes but does not validate structure. Run the result through an XML validator if you need to be sure.
This calculator gives general estimates only and is not professional advice. Reviewed for general accuracy by Prof. Dr. Khalil Mudassar, PhD.