XML Escape / Unescape
Escape special XML characters to their entity equivalents before embedding text inside XML documents, SOAP messages, or XHTML. Unescape XML entities back to readable characters when reading or processing XML content.
Last updated: May 28, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is XML Escape / Unescape?
XML defines five characters with special syntax meaning: & (ampersand), < (less-than), > (greater-than), " (double quote), and ' (single quote). When these appear in text content or attribute values, they must be represented as named entities — &, <, >, ", and ' — or the XML document becomes malformed and parsers will reject it.
Note that XML uses &apos; for single quotes, whereas HTML uses &#039;. This tool applies the correct XML entity set so the output is valid in XML and XHTML contexts.
How to Use XML Escape / Unescape
Paste your text into the input field
Click "Escape XML" to convert special characters to XML entities
Click "Unescape XML" to convert entities back to their original characters
Copy the output for use in your XML document, API payload, or XHTML template
Common Use Cases
- Backend developers escaping user-provided strings before inserting them into XML documents or SOAP request bodies.
- API integrators encoding text values for XML-based web service payloads where unescaped characters would break the schema.
- XHTML template developers ensuring content strings are valid in strict XML parsing contexts.
- Data engineers transforming CSV or database content into XML format without breaking the structure.
- QA engineers verifying that XML serialization handles all five reserved characters correctly.
Example Input and Output
Escaping a product description before embedding it as a text node in an XML product catalog.
Tom & Jerry's <Adventure> said "It's great!"Tom & Jerry's <Adventure> said "It's great!"Escape before insert
Always escape text content before constructing XML by string concatenation. Building XML with template literals or string joins without escaping is a common source of malformed documents.
Browser-side only
All processing happens in your browser. No content is sent to a server.

