Emoji & Symbols in HTML
Modern text on the web is Unicode, and Unicode includes thousands of emoji and symbol characters right alongside letters and digits. You can type an emoji directly into your HTML source, reference it with a numeric or named character reference, or reach for a dedicated font/icon system. This page covers how emoji render, when to use them, and how to keep them accessible.
Typing Emoji Directly
Because HTML documents are just Unicode text, you can paste an emoji character straight into your markup as long as the file is saved with UTF-8 encoding and the page declares that encoding.
emoji-direct.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Emoji Example</title> </head> <body> <p>Great job! 🎉 Keep it up 💪</p> <button>Add to cart 🛒</button> </body> </html>
<meta charset="UTF-8"> (or a server header declaring UTF-8), emoji and other multi-byte characters can render as garbled boxes or question marks. Modern tooling defaults to UTF-8, but always double-check when copying content from other sources.Character References vs Raw Unicode
Most everyday symbols (copyright, trademark, arrows, currency signs) have named or numeric HTML entities. Emoji, however, mostly live outside the "entity" set and are usually written as raw Unicode characters or numeric references using their codepoint.
Approach | Example | Notes |
|---|---|---|
Raw Unicode character | 🎉 (typed directly) | Simplest; requires UTF-8 source file |
Numeric character reference (decimal) | 🎉 | Codepoint-based; works regardless of file encoding |
Numeric character reference (hex) | 🎉 | Same codepoint, hexadecimal form |
Named entity | © / ™ | Only exists for a small, fixed set of legacy symbols — not emoji |
numeric-reference.html
<!-- These three lines render the same "party popper" emoji --> <p>🎉</p> <p>🎉</p> <p>🎉</p>
Rendering Consistency Across Platforms
Emoji are defined by Unicode (the codepoint and its meaning), but they are drawn by the operating system or browser's emoji font. That means the same codepoint can look noticeably different depending on where a visitor views your page.
Apple, Google, Microsoft, and Samsung each ship their own emoji artwork, so 🎉 looks slightly different on iOS, Android, and Windows.
Older operating systems may not have glyphs for newly-added emoji at all, showing a fallback box (
□) or question mark instead.Emoji rendered inside an
<img>(e.g. from a CDN like Twemoji) look identical everywhere, at the cost of an extra network request per icon set.You generally cannot control emoji color or style with CSS the way you can with icon fonts — the OS renderer owns the artwork.
font-size and color (for monochrome symbol characters) like any other glyph — no extra markup needed to make one bigger.Accessibility: Screen Readers Speak Emoji
Screen readers announce emoji using their Unicode name, not a silent decoration. A heart emoji is read as "red heart", a rocket as "rocket", and so on. That has real consequences for how you use them in content.
Visual: "Ship it! 🚀🚀🚀" Screen reader hears: "Ship it! rocket rocket rocket"
aria-label.accessible-emoji.html
<!-- Bad: screen reader announces "trash can button" with no context --> <button>🗑️</button> <!-- Better: visible label plus decorative icon --> <button> <span aria-hidden="true">🗑️</span> Delete item </button> <!-- Or: icon-only button with an explicit accessible name --> <button aria-label="Delete item">🗑️</button>
<span aria-hidden="true"> so assistive technology skips over it entirely.Common Symbol Entities Worth Knowing
Entity | Renders as | Meaning |
|---|---|---|
© | © | Copyright |
® | ® | Registered trademark |
™ | ™ | Trademark |
° | ° | Degree sign |
± | ± | Plus-minus |
× | × | Multiplication sign |
÷ | ÷ | Division sign |
… | … | Horizontal ellipsis |
— | — | Em dash |
→ | → | Right arrow |
Best Practices
Always declare
<meta charset="UTF-8">and save files as UTF-8 when embedding emoji or symbols.Use emoji to add tone or a quick visual cue, not to convey information that has no text equivalent.
Never use an emoji as the sole content of an interactive element without an accessible name.
Prefer named/numeric entities for legacy typographic symbols (©, ×, —); prefer raw Unicode for emoji.
Test important pages on at least one mobile OS if emoji rendering consistency matters to your brand.