Why HTML entities exist
HTML uses certain characters for syntax โ like angle brackets for tags. So how do you display an actual < or > character on a web page without confusing the browser?
The answer is HTML entities. An entity is a special code that represents a character. When the browser sees <, it knows you want to display the less-than symbol, not start a tag.
Entities are essential for:
- Reserved characters โ
<,>,&, quotes โ that have special meaning in HTML - Special symbols โ ยฉ copyright, โข trademark, โฌ euro โ that aren't on your keyboard
- Non-breaking spaces โ spaces that won't wrap text to the next line
- International websites โ currency symbols (โน, ยฃ, โฌ, ยฅ, โฆ) and emojis (๐, ๐ฎ๐ณ, ๐)
& directly in HTML โ use & instead.
Reserved character entities
These four characters have special meaning in HTML and MUST be escaped if you want to display them:
| Character | Entity Name | Decimal Code | Use Case |
|---|---|---|---|
| < | < |
< |
Less than in math expressions |
| > | > |
> |
Greater than in math expressions |
| & | & |
& |
Ampersands in text (like in company names) |
| " | " |
" |
Quotation marks in text |
Common symbol entities
Beyond reserved characters, HTML provides entities for hundreds of symbols. Here are the most useful ones for web development:
Numeric entities (decimal & hex)
Not every symbol has a named entity. That's where numeric entities come in. You can reference any Unicode character by its code point using decimal or hexadecimal format.
Decimal: < โ The number 60 (code for <)
Hexadecimal: < โ The hex code 3C (also code for <)
₹) and Nigerian Naira (₦) are common in e-commerce sites serving Africa and India.
Non-breaking spaces
A regular space ( ) is flexible โ the browser can wrap it to the next line. A non-breaking space ( ) prevents this, keeping two words together on the same line.
When to use :
- Currency followed by a value:
USD $100โ keeps currency symbol and amount together - Product codes or serial numbers:
Model XYZ-123 - Dates or times:
April 18, 2026 - Names:
John Doeโ (though rarely used in modern web design)
Emojis in HTML
Emojis are part of the Unicode standard. With proper UTF-8 encoding, you can paste emojis directly into HTML โ no entities needed (though you can use codes if you prefer).
<meta charset="UTF-8"> in your <head>. Without it, emojis and special characters will display as garbled text.
Arrows and more symbols
HTML includes entities for directional arrows and many other special symbols:
| Symbol | Entity | Decimal Code | Use Case |
|---|---|---|---|
| โ | → |
→ |
Navigation, "next" links |
| โ | ← |
← |
Navigation, "back" links |
| โ | ↑ |
↑ |
Scroll to top indicators |
| โ | ↓ |
↓ |
Expand/dropdown indicators |
| โค | ≤ |
≤ |
Math, "less than or equal" |
| โฅ | ≥ |
≥ |
Math, "greater than or equal" |
| โข | • |
• |
Bullet points |
| โฆ | … |
… |
Ellipsis (...) |
Task: Create an HTML page showing product prices in 5 different currencies with appropriate symbols and emojis.
Requirements:
- Use
<meta charset="UTF-8">in the head - Show prices in at least 5 currencies: Rupee (โน), Dollar ($), Euro (โฌ), Pound (ยฃ), and Naira (โฆ)
- Include copyright notice using
© - Add trademark symbol using
™ - Include at least 3 emojis (country flags, product icons, etc.)
- Use non-breaking spaces where appropriate
- Format it nicely with HTML structure (h1, h2, lists, or tables)
Use the Try It Yourself editor above as a starting point, then modify and extend it!
Hint: Start with a basic HTML skeleton. Create a product list with prices. For each product, show the price in multiple currencies using entities like ₹ for rupee, $ for dollar, € for euro. Add a footer with copyright © 2026 and your school name. Wrap everything in a nice layout.
Key takeaways
- HTML entities let you display reserved characters (
<,>,&) and special symbols without confusing the browser. - Reserved characters MUST use entities: Always use
<,>,&in HTML content. - Named entities are easier to read:
©,€,£,™. - Numeric entities work for any Unicode character:
₹(rupee),₦(naira). - Non-breaking spaces (
) prevent text from wrapping โ useful for currency + amount. - Emojis need UTF-8: Always include
<meta charset="UTF-8">and you can paste emojis directly. - International websites use entities for currency symbols (โน, $, โฌ, ยฃ, ยฅ, โฆ) to display correctly everywhere.
Test your knowledge
You've finished HTML.
Now build with CSS.
Join the Best AI Programs โ three 5-month courses, fully online, with placement assistance. Week 1 is free.
Explore our AI-era courses โ