HTML — Lesson 13
HTML Entities & Symbols
Using special characters and symbols in HTML.
HTML Entities & Symbols
HTML entities let you display reserved characters and special symbols that cannot be typed directly or have special meaning in HTML.
Entity Syntax
Entities follow the format: &name; or &#number;
<!-- By name -->
< <!-- less than: < -->
> <!-- greater than: > -->
& <!-- ampersand: & -->
<!-- By numeric code -->
< <!-- also < -->
> <!-- also > -->
Common HTML Entities
| Entity | Code | Character | Use Case |
|---|---|---|---|
& | & | & | Ampersand in text |
< | < | < | Less-than sign |
> | > | > | Greater-than sign |
| | Space | Non-breaking space |
© | © | © | Copyright symbol |
® | ® | ® | Registered trademark |
™ | ™ | ™ | Trademark symbol |
— | — | — | Em dash |
– | – | – | En dash |
" | " | " | Double quote in attributes |
Non-Breaking Spaces
prevents line breaks at that position and collapses multiple spaces.
<!-- Normal spaces collapse: "A B C" becomes "A B C" -->
<p>A B C</p>
<!-- nbsp keeps spaces and prevents wrapping -->
<p>A B C</p>
<p>100 km</p> <!-- "100 km" won't break apart -->
Displaying Code in HTML
When showing code examples, you must escape HTML characters.
<p>Showing HTML code without entities:</p> <code><p>Hello & Welcome!</p></code> <p>Special symbols and emoji:</p> <p>Arrow: → → ♣ ♥ ♦</p> <p>Copyright: © 2026 My Company</p> <p>Currency: $ € £ ¥</p> <p>Math: ± × ÷ ≠</p>
Tip: The most critical entities to remember are
&, <, and >. Any time you display HTML code as text, these three must be escaped.
Practice what you learned in the Deoit Editor — a free, browser-based code editor.
Open Editor →