XML Escape

Escape or unescape special characters for XML, HTML attributes, JSON or JS strings.

All processing on this page runs locally in your browser unless noted otherwise.

Input

Output

How to use

  1. Paste the raw or already-escaped text.
  2. Pick mode and Escape / Unescape, then Run.
  3. Use quick templates for HTML attribute, JSON or JS embedding.

FAQ

Which characters are escaped in XML mode?

ampersand, less-than, greater-than, double-quote and apostrophe.

Is this the same as HTML entities?

XML mode uses XML entities; HTML attribute mode focuses on attribute-safe escaping.

Related tools