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.
Ctrl/⌘ + Enter to run
Input
Output
How to use
- Paste the raw or already-escaped text.
- Pick mode and Escape / Unescape, then Run.
- 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.