XML Escape / Unescape

Escape or unescape the five XML special characters.

Also called: escape XML, XML entities.

FreeNo sign-upRuns in your browser
DEVELOPER

XML Escape / Unescape

Escape or unescape the five XML special characters.

Runs locally in your browser
Ready. Fill in the fields above, then press Run tool.
Privacy note: this tool runs in your browser, so the text you enter stays on your device.

Find a tool

Loading tools…

Watch: how to use the XML Escape / Unescape (14 seconds)

Recorded on a phone, steps written on screen, no sound.

About the XML Escape / Unescape

Escape or unescape the five XML special characters: & < > " ' become &amp; &lt; &gt; &quot; &apos;.

The five characters

Escaping replaces the five characters that have a meaning in XML: & becomes &amp;, < becomes &lt;, > becomes &gt;, the double quote becomes &quot; and the apostrophe becomes &apos;. Unescaping turns these five back.

Use it before putting text inside an XML element or attribute, for example a product name such as Fish & Chips in a feed or a sitemap. Other characters, including Urdu and emoji, are left as they are, because XML in UTF-8 accepts them.

How to use the XML Escape / Unescape

  1. Enter your textType or paste your text.
  2. Pick the optionsaction (the defaults suit most uses).
  3. Press Run toolThe result appears right under the button.
  4. Copy or download the resultCopy text results with Copy output; when the tool makes a picture or file, use its Download button.

This tool works inside your browser: what you enter stays on your device.

Example

A sample input and the result the XML Escape / Unescape gives for it (produced by the tool itself, not typed by hand).

Input text
<b>Tea & coffee</b> for "everyone"
Action
Escape

Result:

&lt;b&gt;Tea &amp; coffee&lt;/b&gt; for &quot;everyone&quot;

Good to know

What you need
You type or choose: Input text
Where it runs
In your browser, on your device.
Cost
Free, no sign-up.

Questions

When do I need this?

When putting text inside XML elements or attributes.

HTML too?

Use HTML Escape / Unescape for HTML.

More tools in Developer

See all Developer tools