TExcelTAD
Home β€Ί HTML β€Ί HTML Emojis

HTML Emojis

Emojis like πŸ˜€, πŸš€ and πŸ• look like small pictures, but to the browser they are just characters β€” exactly like the letter A or the digit 7. That means you can put them in headings, buttons, list items and even the page title without any image files.

Emojis are Unicode characters

Each emoji has a Unicode code point. The grinning face is U+1F600, the rocket is U+1F680. Because they are characters, you can:

  • type or paste them directly into your HTML (with UTF-8 encoding),
  • write them as numeric references, such as 😀 or 😀,
  • change their size with font-size, just like text.
html Β· try it yourself
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
</head>
<body>
  <h1>Hello, emojis! πŸ‘‹</h1>
  <p>Pasted directly: πŸ˜€ πŸš€ πŸ•</p>
  <p>Decimal references: &#128512; &#128640; &#127829;</p>
  <p>Hex references: &#x1F600; &#x1F680; &#x1F355;</p>
</body>
</html>

Note: The <meta charset="UTF-8"> line tells the browser how to decode the bytes of your file. Without it, a pasted emoji might turn into garbled characters like Γ°ΕΈΛœβ‚¬.

Emojis grow with font-size

Since an emoji is text, CSS text properties apply. font-size makes it bigger; color usually has no effect, because most emojis are drawn in full colour by the system's emoji font.

html Β· try it yourself
<style>
  span { display: inline-block; margin: 4px; }
</style>
<span style="font-size:16px">🌱</span>
<span style="font-size:32px">🌿</span>
<span style="font-size:64px">🌳</span>
<span style="font-size:96px">🌲</span>

Some useful code points

Emoji Name Decimal Hex
πŸ˜€ grinning face &#128512; &#x1F600;
❀️ red heart &#10084; &#x2764;
πŸ‘ thumbs up &#128077; &#x1F44D;
πŸš€ rocket &#128640; &#x1F680;
βœ… check mark button &#9989; &#x2705;
⚠️ warning &#9888; &#x26A0;
🌐 globe with meridians &#127760; &#x1F310;

Combined emojis

Some emojis are made of several code points glued together:

  • Skin tones: πŸ‘‹ followed by a modifier such as U+1F3FD gives πŸ‘‹πŸ½.
  • Zero Width Joiner (ZWJ) sequences: πŸ‘© + U+200D + πŸ’» becomes a single πŸ‘©β€πŸ’» "woman technologist".
  • Flags: two "regional indicator" letters, such as πŸ‡» + πŸ‡³, become πŸ‡»πŸ‡³.

If a device does not know a combination, it shows the separate pieces side by side instead. This is a graceful fallback, so you do not have to worry about breaking the page.

html Β· try it yourself
<p style="font-size:40px">
  &#x1F44B;&#x1F3FD;
  &#x1F469;&#x200D;&#x1F4BB;
  &#x1F1FB;&#x1F1F3;
</p>
<p>Wave + skin tone, woman + ZWJ + laptop, V + N flag letters.</p>

Using emojis well

Emojis make interfaces friendly, but a screen reader reads them aloud by name ("rocket", "red heart"). A row of ten fire emojis becomes ten spoken words! Keep these guidelines in mind:

Situation Recommendation
Decorative emoji next to text Hide it from screen readers with aria-hidden="true"
Emoji that carries meaning on its own Wrap it in <span role="img" aria-label="...">
Important information Don't rely only on the emoji; add words too
html Β· try it yourself
<style>
  button { font-size: 18px; padding: 8px 14px; margin: 4px; }
</style>
<button><span aria-hidden="true">πŸ’Ύ</span> Save</button>
<button><span aria-hidden="true">πŸ—‘οΈ</span> Delete</button>
<p>Status: <span role="img" aria-label="success">βœ…</span></p>
<p>Rating: <span role="img" aria-label="4 out of 5 stars">β­β­β­β­β˜†</span></p>

Tip: On Windows press Win + ., on macOS press Ctrl + Cmd + Space to open the emoji picker and insert an emoji directly into your editor.

Test yourself

What is an emoji, from the browser's point of view?

  1. A tiny image file
  2. A Unicode character
  3. A special HTML tag
  4. A CSS icon

Which CSS property makes an emoji bigger?

  1. width
  2. zoom-emoji
  3. font-size
  4. scale-text

How should you mark up a purely decorative emoji next to a button label?

  1. Add aria-hidden="true" to it
  2. Put it in an <img> tag
  3. Add alt text
  4. Use <emoji>