Encoding

XML Escape

Turn markup-sensitive characters into XML entities — safe to paste into any XML or HTML document.

Escaping runs locally in your browser. Nothing is uploaded, logged, or stored.

0 chars
0 chars

How to use

  1. Paste the raw text into the input panel.
  2. Click Escape — the five XML special characters become named entities.
  3. Copy the result into your XML element, attribute, or HTML.

Which characters are escaped?

XML reserves five characters: <, >, &, ", and '. Any of them appearing raw in text or attribute values makes the document malformed or changes its meaning. This tool replaces all five with their named entities, matching what CDATA-free XML serializers produce.

Reverse direction? Use the XML Unescape tool. Working with JSON instead? See the JSON Escape tool for JSON-specific string escaping.

Examples

Embed code samples

Paste an HTML or XML snippet as documentation text inside another XML file without breaking it.

Build attribute values by hand

Escape user-facing text before placing it into an XML attribute when hand-editing a feed or config.

Frequently Asked Questions

Is my text uploaded anywhere?+
No. Escaping happens entirely in your browser.
Which entities are used?+
Named entities: &amp;lt; &amp;gt; &amp;amp; &amp;quot; &amp;apos; — understood by every XML parser.
Does it escape HTML tags too?+
Yes — since HTML is XML-compatible in its entity handling, the same output works for displaying code on a web page.
What about other special characters?+
Non-ASCII and punctuation characters are valid in XML text and are left unchanged. Only the five reserved characters need escaping.

Related Tools

Looking for something else? Browse all tools