Styling, Colors & SymbolsExtra· 30 min read

Entities, Symbols, Emojis & Charset

Display reserved characters, special symbols and emojis correctly — and never see “�” again.

What you will learn

  • Use HTML entities for reserved characters
  • Insert symbols and emojis
  • Understand why UTF-8 matters

Reserved characters need entities

Some characters are reserved. The browser thinks < starts a tag. To show it literally, use an entity — a code that starts with & and ends with ;.

You want to showType this entity
< (less than)&lt;
> (greater than)&gt;
& (ampersand)&amp;
© (copyright)&copy;
® (registered)&reg;
a non-breaking space&nbsp;
Entities show reserved characters
<p>To write a tag in text, type &lt;p&gt; like this.</p>
<p>&copy; 2026 CodingClave &amp; Friends</p>
<p>5 &lt; 10 and 10 &gt; 5</p>
Live preview

Each entity is replaced by one real character: &lt; becomes <, &gt; becomes >, &amp; becomes &, and &copy; becomes ©. So we can safely *show* a <p> tag as text instead of the browser trying to run it as a real tag.

Note: Output: To write a tag in text, type <p> like this. © 2026 CodingClave & Friends 5 < 10 and 10 > 5

Symbols and emojis

You can paste symbols (★ ₹ → ✓) and emojis (🎉 🚀 ❤️) directly into your HTML. They work as long as your page uses UTF-8.

Symbols and emojis paste right in
<p>Rating: ★★★★☆</p>
<p>Price: ₹499 only →</p>
<p>We love teaching! 🎉🚀❤️</p>
Live preview

These stars, the rupee sign, the arrow and the emojis were pasted straight into the text — no entity codes needed. They display correctly because the page uses UTF-8 (covered just below), the character set that understands almost every symbol and emoji.

Note: Output: Rating: ★★★★☆ Price: ₹499 only → We love teaching! 🎉🚀❤️

Why UTF-8?

The <meta charset="UTF-8"> tag in your <head> tells the browser which character set to use. UTF-8 supports almost every character and emoji on Earth.

Watch out: If symbols or emojis show as boxes or “�”, your page is missing <meta charset="UTF-8"> — add it to the <head>.

Q. How do you correctly display a literal "<" character on the page?

Answer: Use the entity &lt; so the browser shows a literal < instead of thinking a tag is starting.

✍️ Practice

  1. Display the text “if (x < 5 && y > 2)” correctly using entities.
  2. Make a 5-star rating line using ★ and ☆ symbols.

🏠 Homework

  1. Create a small “copyright footer” using &copy;, the year, and one emoji.
Want to learn this with a mentor?

CodingClave runs guided, project-based training (28-day, 45-day & 6-month batches).

Explore Training →