AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
Escape or unescape XML special characters. Convert & < > " ' to/from XML entities.
XML escaping is the process of converting special characters in XML content to their predefined entity references. According to the XML specification (W3C), five characters must be escaped when used in XML text content or attribute values to maintain well-formed XML.
For example, the string Tom & Jerry said "Hello" becomes Tom & Jerry said "Hello" when properly escaped for XML.
| Character | Entity | Description |
|---|---|---|
| & | & | Ampersand |
| < | < | Less than |
| > | > | Greater than |
| " | " | Double quote |
| ' | ' | Single quote |
Note: > escaping is not strictly required in XML text content but is recommended for readability. " is required only in attribute values delimited by double quotes, and ' only in attribute values delimited by single quotes.
The XML specification requires that & (ampersand) and < (less than) always be escaped in text content. In attribute values, the quote character used to delimit the attribute (" or ') must also be escaped. The > character should be escaped to avoid confusion with the closing ]]> sequence in CDATA sections.
XML and HTML share the same five predefined entities (&, <, >, ", '), but HTML also supports many named entities (like © for ©) that XML does not. In XML, only the five predefined entities and numeric character references (©) are valid.
It depends on context. In XML attribute values delimited by double quotes, escape " as ". In attribute values delimited by single quotes, escape ' as '. Outside of attribute values, neither needs to be escaped. This tool lets you toggle each independently.
Numeric character references (A for 'A', A for 'A') represent characters by their Unicode code point in decimal or hexadecimal. They are useful for encoding characters that don't have named entities in XML, especially non-ASCII characters.
Yes. XHTML follows XML syntax rules, so the same escaping rules apply. In fact, XHTML requires stricter escaping than regular HTML — all five predefined entities must be used, and self-closing tags are required.
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026