XML Escape
Escape special XML characters for safe inclusion in XML documents.
Escape the five characters that have special meaning in XML: & becomes &, < becomes <, > becomes >, " becomes " and ' becomes '. Use it before putting text into XML elements or attribute values, so a stray ampersand or angle bracket doesn't break the document. XML unescape reverses it.
Need the reverse? XML Unescape
Common use cases
- Put text containing & or < into an XML file
- Prepare values for an XML or SOAP request
- Fix a feed broken by an unescaped ampersand
How to use
- Paste the text.
- Copy the escaped result.
FAQ
Do I need to escape quotes?
Only inside attribute values that use the same kind of quote. Escaping all five characters is always safe.
What about CDATA?
A <![CDATA[ … ]]> section lets you include text without escaping, as long as it doesn't contain ]]>.
Related tools
- XML UnescapeConvert escaped XML entities back to their original characters.
- HTML EscapeConvert special HTML characters to their entity equivalents for safe display.
- URL EncodeEncode text for safe use in URLs by converting special characters to percent-encoded format.
- URL DecodeDecode percent-encoded URLs back to readable text with special characters restored.
- Base64 EncodeConvert text or binary data to Base64 encoded string for safe transmission.
- Base64 DecodeDecode Base64 encoded strings back to original text or binary data.