XML Escape
Replace the five XML special characters with their entities, and back again.
Runs entirely in your browser.
Escape a String for XML
About XML Escape
XML reserves five characters, and each has a named entity: & becomes &, < becomes <, > becomes >, " becomes " and ' becomes '. The ampersand has to be replaced first, or you would go on to escape the ampersands you just introduced.
XML and HTML differ on one of these: HTML has no ' in its original entity set and uses the numeric ' instead. If you are working with HTML rather than XML, HTML Entities is the page you want.
Other Escaping Tools
- Escape / Unescape — every format on one page
- SQL Escape — quotes and backslashes for SQL literals
- Regex Escape — escape regular expression metacharacters
- CSV Escape — quote a value for a CSV field
- Backslash Escape — newlines and tabs as \n and \t
- HTML Entities — encode and decode HTML entities
- URL Encode / Decode — percent-encoding
- JSON Stringify — escape JSON into a string literal