Advanced HTML

HTML Emojis

Emojis add emotion, personality, and visual appeal to web pages.
They are part of the Unicode character set, which means you can use them directly in HTML just like text.
HTML supports emojis natively - no extra library or image is required.

How Emojis Work in HTML

Every emoji is represented by a Unicode value - a unique code assigned to that emoji.
You can insert an emoji either by directly typing it or using its HTML entity (Unicode code point).

Syntax

html

πŸ˜€  <!-- Hexadecimal code -->
πŸ˜€  <!-- Decimal code -->

Both represent the πŸ˜€ emoji.

Example 1: Using Emojis Directly

html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>HTML Emojis</title>
</head>
<body>
  <h2>Using Emojis in HTML</h2>
  <p>I love HTML 😍 and CSS 🎨!</p>
  <p>Learning is fun πŸš€βœ¨</p>
</body>
</html>

Output:

I love HTML 😍 and CSS 🎨!
Learning is fun πŸš€βœ¨

Example 2: Using Unicode (Entity Code)

html

<p>Smile: πŸ˜€</p>
<p>Heart: ❀</p>
<p>Star: ⭐</p>
<p>Rocket: πŸš€</p>

Output:

Smile: πŸ˜€
Heart: ❀️
Star: ⭐
Rocket: πŸš€

Common Emoji Unicode Codes

EmojiDescriptionDecimal CodeHex Code
πŸ˜€Grinning Face&#128512;&#x1F600;
πŸ˜‚Face with Tears of Joy&#128514;&#x1F602;
😍Heart Eyes&#128525;&#x1F60D;
😎Cool Face&#128526;&#x1F60E;
😒Crying Face&#128546;&#x1F622;
😑Angry Face&#128545;&#x1F621;
❀️Red Heart&#10084;&#x2764;
⭐Star&#11088;&#x2B50;
πŸ”₯Fire&#128293;&#x1F525;
πŸš€Rocket&#128640;&#x1F680;
🌍Earth Globe&#127757;&#x1F30D;
βœ…Check Mark&#9989;&#x2705;
πŸ’‘Light Bulb&#128161;&#x1F4A1;
πŸ“žTelephone&#128222;&#x1F4DE;

Important Notes

  • Always include <meta charset="UTF-8"> in your <head> section - this ensures emojis display correctly.
  • Emojis render differently on Windows, macOS, Android, and iOS, depending on the system font.
  • You can also use CSS font-family to control emoji style slightly (e.g., font-family: Segoe UI Emoji;).

Example 3: Styled Emoji Text

html

<p style="font-size: 24px; font-family: 'Segoe UI Emoji';">
  HTML makes me πŸ˜ƒ and CSS makes me 🎨
</p>

Browser Support

Chrome
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesYes

Conclusion

Emojis make web pages more expressive and user-friendly.
With HTML and Unicode, you can easily add thousands of emojis without relying on images - making your design lighter, modern, and fun.