What are HTML Entities?
HTML Entities are used to display special characters that HTML normally treats as code.
Example:
If you write < directly, HTML thinks it is a tag.
Simple Rule
- Entity starts with &
- Ends with ;
| Symbol | Entity Name | Entity Code |
| < | less than | < |
| > | greater than | > |
| & | ampersand | & |
| " | double quote | " |
| ' | single quote | ' |
Example
<p>HTML tag starts with <html></p>Output:
HTML tag starts with <html>Space Entities
| Space Type | Entity |
| Normal space | |
| Two spaces | |
Currency Symbols
| Symbol | Entity |
| ₹ | ₹ |
| $ | $ |
| € | € |
Math Symbols
| Symbol | Entity |
| © | © |
| ® | ® |
| ™ | ™ |
Emoji Example 😀
<p>I ❤️ HTML</p>When to Use HTML Entities?
- To show code in browser
- To avoid HTML errors
- To show symbols safely
One Line Remember
HTML entities display special characters safely
