-
Hajipur, Bihar, 844101
HTML entities are special codes that allow you to display characters that cannot be typed directly or have special meaning in HTML. Some characters are reserved, some are invisible, and some cannot be written using a keyboard. Entities help you display them correctly in your webpage. In this chapter, you will learn what HTML entities are, why they are needed, how to write them, and how to use the most common entity codes with examples.
HTML entities are encoded versions of characters. Instead of typing the character directly, you write a specific code that the browser converts into the correct symbol. Entities always start with & and end with ;.
<div>
The browser displays:
<div>
Entities are especially important for reserved HTML characters like < and > because the browser normally treats them as part of the HTML structure.
Some characters cannot be used directly in HTML for different reasons. Entities solve these problems.
to show reserved characters in text
to display special symbols not available on keyboards
to avoid conflicts with HTML syntax
to ensure characters display correctly in all browsers
to support various languages and mathematical symbols
Reserved characters like <, >, ", ', and & must be written as entities inside HTML content.
Entities come in two forms:
These use a readable name.
& → &
" → "
These use a numeric code.
© → ©
★ → ★
Both versions work, but named entities are easier to remember.
These characters are part of the HTML language. If you write them normally, the browser might misinterpret them.
< and >Used for HTML tags.
<h1>Title</h1>
&Used to start an entity.
& → &
" → "
' → '
<p>Use <strong> for bold text.</p>
This prevents the browser from trying to render <strong> as actual HTML.
HTML offers ready-made entities for common symbols.
© → ©
® → ®
™ → ™
€ → €
£ → £
¥ → ¥
These symbols are used often in business websites and branding footers.
Math symbols are not easy to type, so entities help you display them.
+ → +
− → −
× → ×
÷ → ÷
√ → √
∑ → ∑
∞ → ∞
These are useful for teaching platforms, calculators and math content.
Different currencies have their own entity codes.
$ → $
€ → €
£ → £
¥ → ¥
¢ → ¢
If your site deals with international pricing, these become essential.
Arrows are used for navigation tips, indicators, and instructions.
← → ←
→ → →
↑ → ↑
↓ → ↓
↔ → ↔
These arrows help you guide users visually.
HTML removes extra spaces by default. To show spacing, you can use (non-breaking space).
Hello World
The browser keeps the spacing exactly as written.
Certain common fractions have ready-made entities.
½ → ½
¼ → ¼
¾ → ¾
You can also use numeric entities for custom fractions.
Some emojis can be displayed using numeric entities if you know the Unicode value.
😀 → 😀
😍 → 😍
Emojis using entities are helpful when you don’t want to load external icon libraries.
<p>
© 2025 MyWebsite. All rights reserved.
Use <code> tags to show HTML symbols like <div>.
Price starts from $199 – limited offer!
</p>
This example uses multiple entities together for layout, symbols and clarity.
| Character | Entity | Result |
|---|---|---|
| < | < |
< |
| > | > |
> |
| & | & |
& |
| " | " |
" |
| ' | ' |
' |
| Symbol | Entity | Result |
|---|---|---|
| © | © |
© |
| ® | ® |
® |
| ™ | ™ |
™ |
| ° | ° |
° |
| Symbol | Entity | Result |
|---|---|---|
| × | × |
× |
| ÷ | ÷ |
÷ |
| √ | √ |
√ |
| ∞ | ∞ |
∞ |
Entities make your content more expressive.
the character is reserved
the symbol is not available on your keyboard
you need Unicode characters
you must prevent the browser from confusing HTML with text
you want clean and valid HTML
the character is normal text (letters, digits)
it doesn’t conflict with HTML rules
Using entities only when needed keeps your code clean.
HTML entities help you display special characters safely and correctly. You learned how entities work, why reserved characters need them, how named and numeric entities differ and how to use symbols, arrows, math signs and emojis. Entities appear in almost every webpage and are essential for clean, valid, readable HTML. With the right entities, your pages can display text and symbols in a clear and consistent way.
Q1. Write HTML to display <html> tags on a page using entities.
Q2. Show the text: Tom & Jerry correctly with the ampersand.
Q3. Display the copyright symbol © using entities.
Q4. Write a paragraph that includes quotes "Hello" using entities.
Q5. Show the registered trademark symbol ® in HTML.
Q6. Use numeric entity to display less than < symbol.
Q7. Display an email address with @ sign properly escaped.
Q8. Show the Euro sign € using a named entity.
Q9. Encode a sentence with multiple special characters: <, >, &.
Q10. Create a list showing different quotation marks using HTML entities.