Development
HTML Entities: A Complete Reference Guide
Learn about HTML entities, when to use them, and a reference table of common characters.
HTML entities are special codes used to display reserved characters and symbols in web pages. Understanding HTML entities is essential for web developers and content creators.
Why HTML Entities Exist
Certain characters have special meaning in HTML. The < and > characters define HTML tags, the & character starts entity references, and quotation marks define attribute values. To display these characters as text rather than code, you must use HTML entities.
Entity Syntax
HTML entities can be written in two ways:
- Named entities: &name; (e.g., & for &)
- Numeric entities: &#number; (e.g., & for &)
- Hex entities: &#xhex; (e.g., & for &)
Essential HTML Entities
| Character | Named | Numeric | Description |
|---|---|---|---|
| & | & | & | Ampersand |
| < | < | < | Less than |
| > | > | > | Greater than |
| " | " | " | Double quote |
| ' | ' | ' | Single quote |
| © | © | © | Copyright |
| ® | ® | ® | Registered |
| ™ | ™ | ™ | Trademark |
| — | — | — | Em dash |
| – | – | – | En dash |
| • | • | • | Bullet |
| Non-breaking space |
When to Use HTML Entities
- Displaying reserved characters (< > & ” ’)
- Inserting special symbols not on your keyboard
- Ensuring correct display across different browsers and encodings
- Preventing XSS (cross-site scripting) attacks by encoding user input
Use our HTML Encoder/Decoder tool to quickly convert between raw text and HTML entities.
htmlentitiesweb
Need text tools?
Try our free online text tools for instant results.