Skip to content

XML Escape / Unescape

Escape or unescape XML characters.

Loading…

About XML Escape / Unescape

Building an RSS item, a SOAP body or a sitemap by hand is fine until a title contains an ampersand and the whole file stops parsing. Escape rewrites & < > " and ' as the entities XML itself defines, using &apos; for the apostrophe. It also deletes control characters that XML 1.0 forbids outright, which can otherwise make a document invalid. Unescape goes the other way, but only for those five names and numeric references.

Features

  • Escapes the five predefined XML entities
  • Writes the apostrophe as &apos;
  • Deletes control characters that XML 1.0 cannot hold
  • Unescape decodes the five named entities and numeric references
  • Leaves HTML-only names such as &copy; as written when unescaping

Limitations

  • Characters XML 1.0 forbids, such as most control codes, are removed from the output rather than escaped, so the text changes.
  • Only text is escaped: the tool does not add CDATA sections, build tags or check that a whole document is well-formed.

How it works

  1. Paste the text or attribute value into the XML Input panel.
  2. Pick Escape or Unescape with the toggle in the middle column.
  3. Check the XML Output panel, which refreshes with every keystroke.
  4. Copy the result with Copy Output and paste it between your tags or inside the attribute quotes.

Example input

Price: $5 <tax not="included">

Frequently asked questions