XML Escape / Unescape

Escape the five XML special characters (< > & " ') so text is safe inside XML elements and attributes, or turn entities back into plain text — in your browser.

Suggested tools

JSON to XML

Convert JSON into well-formed XML.

JSONXML
Open Tool

XML to JSON

Convert XML into clean JSON.

XMLJSON
Open Tool

XML Formatter

Beautify, minify and validate XML instantly in your browser.

XML
Open Tool

XML to CSV

Turn list-style XML into a CSV table, one row per record.

XMLCSV
Open Tool

CSV to XML

Convert CSV rows into well-formed XML elements.

CSVXML
Open Tool

XML to YAML

Convert XML into YAML.

XMLYAML
Open Tool

About XML Escape / Unescape

XML Escape replaces the five characters that XML reserves — & < > " ' — with the entities &amp; &lt; &gt; &quot; and &#39;, so any text can be placed safely inside XML elements and attribute values without breaking the document.

XML Unescape decodes those entities and numeric character references (&#8377; or &#x20B9;) back into text. Everything runs locally in your browser — the text you paste is never uploaded.

How to use XML Escape / Unescape

  1. Paste text, or XML containing entities.
  2. Press Escape or Unescape.
  3. Copy the result into your XML, SOAP message or config file.

Key features

  • Escapes all five XML special characters
  • Safe for element text and quoted attributes
  • Decodes named and numeric character references
  • Escape and Unescape on one page

Example

Input
Price < ₹500 & "Free" delivery
Output
Price &lt; ₹500 &amp; &quot;Free&quot; delivery

When to use XML Escape / Unescape

  • Putting text with &, < or quotes into XML elements or attributes.
  • Preparing values for SOAP requests and XML config files.
  • Reading entity-encoded text from XML exports.

Tips and common problems

  • & and < must always be escaped in XML text; quotes matter inside attributes.
  • XML does not know HTML entities such as &nbsp; — use &#160; instead.
  • CDATA sections are an alternative for long blocks of text with many special characters.

Frequently asked questions

Only & and < are strictly required in element text, and quotes only inside attributes. Escaping all five is always safe and avoids mistakes.