HTML escaping

HTML escaping replaces the special characters (<, >, &, quotes) of a piece of data with entities, so that it is displayed as text and not interpreted as HTML. It is done at output, depending on context (HTML, attribute, JavaScript, URL).

Example

&lt;script&gt;alert(1)&lt;/script&gt;

Related concepts

The whole glossary