Why Entities Exist
Some characters, like < and >, have special meaning in HTML because they define tags. To display them as literal text rather than markup, you need to use an entity instead.
Common Entities
| Entity | Renders As | Meaning |
|---|---|---|
| < | < | Less than |
| > | > | Greater than |
| & | & | Ampersand |
| " | " | Double quote |
| ' | ' | Apostrophe |
| | Non-breaking space | |
| © | © | Copyright symbol |
| ♥ | ♥ | Heart symbol |
Using Entities
<p>Use <div> to group content.</p>
<p>Terms & Conditions</p>
<p>© 2026 DevAcademy</p>Numeric Character References
Any Unicode character can also be written using a numeric reference:   for a non-breaking space, or © using its hexadecimal code point.
Numeric References
<p>© 2026 DevAcademy</p>
<p>❤ I love HTML</p>The Non-Breaking Space
inserts a space that browsers will not collapse or break a line at — useful for keeping two words together, like "10 km".
Escape User-Generated Content
When displaying text that comes from users (comments, form input), always escape characters like < and & to entities on the server, or use a templating system that does so automatically. Failing to do this can lead to cross-site scripting (XSS) vulnerabilities.
Best Practice
Use named entities (&, <) for readability when writing markup by hand, and rely on your framework’s automatic escaping when rendering dynamic, user-supplied content.