$ html-escape

HTML Entity Encoder / Decoder

Escape text for safe use in HTML, or decode entities like & and ' back to characters.

Input
Output
Ad slot

When to escape

Any user-supplied text placed into HTML must have < > & " \x27 escaped, otherwise it can break the page or inject scripts (XSS). Encoding turns <script> into &lt;script&gt;, which displays literally. Decoding does the reverse, including named entities like &copy; and numeric ones like &#169;.