Emojis 😀 are not special HTML magic — they are simply regular Unicode characters, just like letters and digits. As covered on the previous page, this means your document must be served with the UTF-8 character set for emoji to display correctly.
HTML Emojis
1) Typing or Pasting Emoji Directly
<p>I love HTML! 😍</p>
<p>Great job! 👍</p>
Because emoji are just Unicode text characters, you can type them directly on your keyboard (using an emoji picker) or paste them straight into your HTML source, as long as the file is saved as UTF-8 and <meta charset="UTF-8"> is declared.
2) Using a Numeric Character Reference
<p>Grinning Face: 😀</p>
<!-- Renders as: --> 😀
Every emoji has a Unicode code point (for example, U+1F600). You can insert an emoji using a decimal numeric character reference in the form &#DECIMAL;. This is useful when you want to guarantee the exact character in your source code without relying on your editor supporting emoji input, or you can use the hexadecimal form &#xHEX; instead.
3) Common Emoji Reference Table
| Emoji | Name | Unicode Code Point | HTML Numeric Entity |
|---|---|---|---|
| 😀 | Grinning Face | U+1F600 | 😀 |
| 👍 | Thumbs Up | U+1F44D | 👍 |
| ❤ | Heart | U+2764 | ❤ |
| 🔥 | Fire | U+1F525 | 🔥 |
You can look up the code point for almost any emoji on the official Unicode Consortium website or an emoji reference site, then use it as a numeric character reference in your HTML.
4) Live Demo: Emoji Rendered in the Page
Coding is fun 😀 Keep learning 👍 We build with ❤ and a little 🔥
The paragraph above was written using a mix of literal emoji characters and numeric character references — both approaches render identically once the browser parses the UTF-8 encoded page.
5) Where You Can Use Emoji
<title>My Awesome Site 🚀</title>
<button>Add to Cart 🛒</button>
<li>✅ Task completed</li>
Emoji can appear almost anywhere regular text can appear — inside <title>, buttons, list items, headings, and even alt attributes — since to the browser they are simply characters, not images.
Best Practices:
- Always declare
<meta charset="UTF-8">before using emoji, or they may not display at all. - The exact appearance of an emoji (its artwork/style) depends on the user's operating system and browser, not on your website — the same code point can look different on Windows, macOS, iOS, and Android.
- Use numeric character references when you want a guaranteed, editor-independent way to embed a specific emoji in source code.
- Avoid overusing emoji in body text; use them sparingly for emphasis, buttons, or visual cues.
- Always pair decorative emoji with descriptive text for accessibility, since screen readers may announce emoji names literally.