Why Use Entities?
Some characters have special meaning in HTML (<, >, &) and must be escaped. Others are hard to type on a keyboard.
Common HTML Entities
| Character | Entity name | Entity number |
|---|---|---|
| < | < | < |
| > | > | > |
| & | & | & |
| " | " | " |
| ' | ' | ' |
| (non-breaking space) | |   |
| © | © | © |
| ® | ® | ® |
| ™ | ™ | ™ |
| € | € | € |
| £ | £ | £ |
| — | — | — |
<!-- Show code in text without it being parsed as HTML -->
<p>Use <h1> for the main heading.</p>
<!-- Renders as: Use <h1> for the main heading. -->
<!-- Non-breaking space keeps words together -->
<p>Price: $9 99</p>
<!-- Copyright notice -->
<footer>© 2025 My Company</footer>Always escape
& as & and < as < when displaying code or user-generated content in HTML — this prevents XSS vulnerabilities.