Turn raw text into XML-safe entities and back. Fix ampersands, angle brackets, and quotes so parsers and attributes behave correctly. All processing runs in your browser.
&Ampersand (escape first)<Less than>Greater than"Double quote'ApostropheXML reserves five characters. The ampersand starts every entity, so if you escape < and > before &, you can end up with something like &lt; instead of <. This tool applies the correct order: ampersand, then angle brackets, then quotes.
Use escape when you are putting user input or external text into an XML element or attribute. Use unescape when you have stored or transmitted XML and need to show or edit the raw characters again. Processing is done locally, so nothing is sent to a server.
XML defines only the five named entities above. Anything else you see written as © came from a DTD or from HTML, and a strict XML parser rejects it. For characters outside those five, use a numeric reference instead: © in decimal or © in hex. Both forms round-trip through this tool.
Text inside a CDATA section is already exempt from escaping, which is the point of it. Running escape over a document that contains CDATA will escape the angle brackets of the section markers themselves and break the block, so strip or restore those by hand.
Escape when the text is heading into a document: user-supplied values going into an element or an attribute, a search term with an ampersand in it, a code sample that contains tags. Unescape when the text is coming back out and a person has to read it, or when a downstream system wants the raw characters rather than the entities.
The common failure is escaping twice. Text that already reads &lt; has been through an escape pass it did not need, usually because a framework escaped it once before your code did. Unescape once and compare before you assume the source data is wrong.
Check the result with the XML Validator if a parser is still rejecting the document, open it in the XML Editor to work on escaped content in place, or switch to the HTML Escape Unescape tool when the target is a web page rather than an XML document, since HTML carries a far longer entity list.