Bytelify

XML Escape

Escape the five reserved XML characters, live as you type, in either direction.

Runs in your browser, nothing sent
xml-escape

Escapes the five reserved XML characters (&, <, >, ", ') to their entity form โ€” type in either field, both directions update live. Runs entirely in your browser.

Need the opposite? HTML Escape

What is XML Escape?

Type text containing &, <, >, ", or ' and see them escaped to their XML entity form instantly, needed whenever that text is going inside XML content or an attribute value. Type in either field, both directions update live. Skipping this step is a common source of malformed XML: an unescaped & or < in a text node breaks parsing entirely. Escaping happens live as you type, entirely in your browser.

XML Predefined Entities

CharacterEscaped Entity
&&amp;
<&lt;
>&gt;
"&quot;
'&apos;

How to Use the XML Escape Tool

  1. 1

    Type or Paste the Text: Enter any text, including the characters & < > " '.

  2. 2

    Read the Escaped Result Instantly: The XML-safe entity form appears automatically as you type.

  3. 3

    Copy the Result: Use the copy button to copy the escaped text for safe insertion into an XML document.

Why These Five Characters

XML uses < and > to delimit tags and & to introduce character references and entities, so a literal occurrence of any of these inside content or an attribute value would be parsed as markup instead of data, usually breaking the document entirely. " and ' are reserved specifically for delimiting attribute values, so a literal one inside a quoted attribute prematurely ends it. Unlike HTML, which defines a large set of named entities for symbols and accented characters, XML defines exactly these five predefined entities. It's a complete, fixed list rather than a common subset, which is why the table above covers all of it.

FAQs

Frequently Asked Questions

Common questions about XML Escape.

The five characters XML reserves: & (&amp;), < (&lt;), > (&gt;), " (&quot;), and ' (&apos;).

& and < always need escaping in XML text content. " and ' only matter inside quoted attribute values (using the matching quote character). > is often left unescaped but is safe to escape everywhere, which is what this tool does by default.

XML defines exactly five predefined entities (&amp; &lt; &gt; &quot; &apos;) and nothing more; any other special character has to use a numeric reference. HTML defines a much larger set of named entities (like &copy; or &euro;) for symbols and accented letters.

Yes, Bytelify's XML Escape tool is free with no account or sign-up required.

No. The escaping runs entirely client-side in your browser, so nothing you type is sent anywhere.