HTML Entity Encode/Decode

Escape < > & " ' into HTML entities, or restore entities back

Encode Decode
Chars: {{ inputText.length }}
Unicode Escape →

About HTML Entities

An HTML entity (HTML Entity) is used to display reserved or invisible characters on a web page. For example, to show a code snippet containing <div>, you must escape < and > as &lt; and &gt;, otherwise the browser parses them as tags.

Common entities include: &amp; (&), &lt; (<), &gt; (>), &quot; ("), &apos; ('), and decimal/hexadecimal forms like &#169; (©). This tool handles all standard entities in both directions.

Examples

Input: <a href="#">link</a>

Encoded: &lt;a href="#"&gt;link&lt;/a&gt;

FAQ

Q: Why escape HTML on a web page?
A: To prevent special characters from being mis-parsed as tags or attributes (breaking the page layout), and as an important defense against XSS injection — always escape untrusted output.
Q: Does decode support numeric entities?
A: Yes. Both named entities (like &copy;) and numeric entities (like &#169; or &#x00A9;) are correctly restored on decode.