Escape XML markup characters for safe insertion into text or attributes.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
Ampersands, less-than, and greater-than signs become predefined entities; optional quote entities protect attribute delimiters, and optional newline references encode line breaks. Ampersands are replaced first so generated entities are not escaped again by later replacements.
<script>alert("XSS & injection")</script>
<script>alert("XSS & injection")</script>
XML elements, attributes, SOAP payloads, and RSS generators escape user text.