Introduction to HTML Emojis

Emojis are icons or stickers used in digital communication. In HTML, emojis are treated as characters from the UTF-8 character set. This means you don't need images to display them; you can use simple character codes.

Why use Emojis?

Emojis add visual interest to your web pages and can convey emotions or concepts quickly. Since they are text-based, they are lightweight and accessible.

How to Display Emojis in HTML

There are three main ways to add emojis to your HTML document:

  1. Direct Input: Just copy and paste the emoji directly into your code (e.g., 😄). Ensure your meta charset is UTF-8.
  2. Decimal Entities: Use the &#decimal; format. For example, 😄 displays 😄.
  3. Hexadecimal Entities: Use the &#xhex; format. For example, 😄 displays 😄.
<p>I am happy &#128512;</p>
<p>I love coding &#128187;</p>
<p>Success! &#128640;</p>

Popular Emoji Codes

EmojiDecimalHex
😀😀😀
🔥🔥🔥