Skip to content
Tutorials Center
My learning

Topics

Lesson 13 of 122 ยท Text Content

Symbols and Emojis

Add math signs, arrows, currency symbols, Greek letters and emoji to your pages with Unicode, and make sure they display everywhere and work with screen readers.

The web is not limited to the letters on your keyboard. A recipe needs a degree sign, a price list needs currency symbols, a physics note needs Greek letters, and a friendly message might want an emoji. All of these are ordinary characters in Unicode, the standard that gives every character in every writing system its own number.

In this lesson you will learn how to add symbols and emoji to HTML, how emoji are built behind the scenes, why a symbol sometimes shows up as an empty box, and how to make sure screen-reader users hear what you meant.

Every symbol has a number

Unicode assigns each character a code point, written as U+ followed by a hexadecimal number. The arrow โ†’ is U+2192, the euro sign โ‚ฌ is U+20AC and the grinning face ๐Ÿ˜€ is U+1F600.

As you saw in HTML Entities, there are three ways to put a character into a page:

  1. Type or paste it directly. With a UTF-8 page (which every page should be), this is the simplest option.
  2. Use a numeric reference built from the code point: → (hex) or → (decimal).
  3. Use a named reference, if one exists: →.

To type symbols directly, use your system's character picker: Win + . on Windows, Ctrl + Cmd + Space on a Mac, or the emoji key on a phone keyboard. Numeric references are useful when you know the code point but cannot easily type the character, or when you want an invisible or confusing character to be obvious in your code.

Common symbols by category

Here is a small gallery of useful symbols, written in all three styles. Run it, then try changing a few code points to explore nearby characters โ€” Unicode groups related symbols together.

Symbol gallery

A few notes on the categories:

  • Math: the real minus sign − (U+2212) is wider than the hyphen - and lines up with the plus sign. Use × for multiplication rather than the letter x. For full equations with fractions and roots, HTML has a dedicated language โ€” see Math with MathML.
  • Arrows: good for "next" links or directions, but do not let an arrow be the only clue. "Next โ†’" is clearer than "โ†’" alone.
  • Currency: many currency signs (Indian rupee โ‚น, Turkish lira โ‚บ, Azerbaijani manat โ‚ผ, Korean won โ‚ฉ, bitcoin โ‚ฟ) have no named reference, so use the character or a numeric reference.
  • Greek letters in names: lowercase is α, uppercase is Α โ€” remember that names are case-sensitive.

Emoji are characters too

An emoji is not an image you insert โ€” it is a character, like any letter. That means it inherits the font size of its surroundings, can be copied and pasted, and is drawn by the visitor's device using its own emoji font. The same ๐Ÿ˜€ looks a little different on Windows, Android and Apple devices.

Many emoji are a single code point, so you can write them as a numeric reference: 😀 is ๐Ÿ˜€ and ☕ is โ˜•. Others are sequences of several code points that the font combines into one picture:

Emoji Built from How it works
๐Ÿ‘‹๐Ÿฝ ๐Ÿ‘‹ + ๐Ÿฝ A skin-tone modifier (U+1F3FBโ€“U+1F3FF) follows the base emoji.
๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿ‘ฉ + ZWJ + ๐Ÿ’ป A zero width joiner (U+200D) glues emoji into a new one.
๐Ÿ‡ฏ๐Ÿ‡ต ๐Ÿ‡ฏ + ๐Ÿ‡ต Two regional indicator letters form a country flag.
โค๏ธ โค + U+FE0F A variation selector asks for the colorful emoji style instead of a plain text symbol.

If a device does not know a combined emoji, it shows the parts side by side โ€” for example a woman and a laptop instead of a woman technologist. Flags are a well-known case: most browsers on Windows show country flags as two letters, because Windows' emoji font has no flag pictures.

This also explains a surprise for JavaScript programmers: what looks like one character can be several code points, and even more "code units" in a JavaScript string.

How many characters is an emoji?

The woman technologist reports a length of 5, three code points, and one visible character. When you count characters for a tweet-style limit or cut text to a maximum length, use Intl.Segmenter (as in the example) so you never slice an emoji in half.

More symbol families

Beyond the everyday set, whole blocks of Unicode are useful to know about. You can type any of them as a character, as &#xHEX;, or, for some, by name:

Family Examples Notes
Legal and marks ยฉ ยฎ โ„ข โ„— (sound recording copyright) ©, ® and ™ have names; the others use numbers
Letterlike symbols โ„“ (script small l), โ„Ž (Planck constant), โ„• (double-struck N), โ„š (double-struck Q), โ„ (double-struck R), โ„ค (double-struck Z) Used in mathematics for number sets; ℕ and ℝ exist as names
Hebrew letterlike โ„ต (alef), โ„ถ (bet), โ„ท (gimel), โ„ธ (dalet) Set theory (cardinal numbers)
Misc. symbols โ™‚ (male), โ™€ (female), โ™ญ (flat), โ™ฏ (sharp) Music and general use
Dingbats โœ— (ballot X), โœ“ (check mark), โœ  (Maltese cross) Decorative; give them a text alternative if they carry meaning

Combining diacritical marks (U+0300 to U+036F) attach to the character before them. The letter e followed by U+0301 shows as รฉ, and n plus U+0303 shows as รฑ. It looks the same as a precomposed é, but the text is made of two code points, which matters when you compare or count strings (JavaScript's normalize() converts between the forms).

Symbols by number

Emoji families

Emoji are grouped in Unicode into families, such as smileys and people (professions, fantasy figures), animals and nature (mammals, birds, insects, sea life), food, travel and places (buildings, landmarks, vehicles), activities, objects (office and communication items) and symbols and flags. Everything above applies to all of them: they are characters, are drawn by the visitor's emoji font, vary by platform, and need aria-label or a visible text when they carry meaning.

HTML
<span role="img" aria-label="Elephant">&#x1F418;</span>
<span role="img" aria-label="Office building">&#x1F3E2;</span>
<span role="img" aria-label="Laptop">&#x1F4BB;</span>

Emoji and accessibility

Screen readers read emoji aloud using their official short names: ๐Ÿ˜€ becomes "grinning face", ๐Ÿ”ฅ becomes "fire". That has two consequences.

Decorative emoji add noise. A heading like "๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ Big news ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰" is read as "party popper party popper party popper Big news party popperโ€ฆ". When an emoji is pure decoration, hide it from assistive technology with aria-hidden="true".

Meaningful emoji need the right name. The official name may not match your intent: ๐Ÿ‘ is "thumbs up", which is fine, but ๐Ÿ™ is "folded hands", whether you meant "thank you" or "please". When an emoji carries meaning on its own, give it a role and a label.

Decorative vs meaningful emoji

The page looks exactly the same, but a screen reader now says "Our shop is open again", "Rating: 4 out of 5 stars" and "Status: Done". The icons in the list are hidden because the text already says everything. You will learn more about role and aria-label in ARIA Roles, States and Properties.

Emoji are seasoning, not the meal. Use them to add tone, not to replace words. Text is searchable, translatable and clear on every device; a row of pictures is not.

When a symbol does not show up

If the visitor's device has no font that contains a character, the browser draws a placeholder โ€” often an empty rectangle nicknamed tofu (โ–ก) โ€” or a box with the code point inside. This is most likely with rare symbols and with the newest emoji, which older phones and computers do not know yet.

To reduce the risk:

  • Prefer well-established characters. Arrows, common math signs and major currency symbols are supported almost everywhere.
  • Test on several systems, especially Windows, Android and an older phone if you can.
  • Add an emoji font stack for emoji-heavy elements, so the browser picks the system's color emoji font:
HTML
<style>
  .emoji {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  }
</style>
  • Keep a text fallback next to any symbol that carries meaning, such as "Next โ†’" or "Rating: 4/5".
  • Use SVG for logos and icons. A company logo is not a character; draw it with SVG instead of hoping a font has it.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which reference displays the right arrow โ†’?

    Hex references start with &#x. &#2192; would be decimal 2192, a different character, and U+2192 is just how the code point is written in documentation.
  2. 2. Why does the emoji ๐Ÿ‘ฉโ€๐Ÿ’ป have a JavaScript length of 5?

    It is woman + zero width joiner + laptop. The two emoji each take two UTF-16 code units, and the joiner takes one.
  3. 3. A heading has party-popper emoji on both sides purely for decoration. What is the best markup for the emoji?

    Decorative emoji should be hidden from assistive technology, otherwise screen readers read their names aloud.
  4. 4. A visitor sees an empty box instead of a symbol. What is the most likely cause?

    Named and numeric references produce the same character. If no installed font can draw it, the browser shows a placeholder, often called tofu.

Summary

  • Every symbol and emoji is a Unicode character with a code point such as U+2192.
  • Add them by typing them directly (with UTF-8), with numeric references (&#x2192;), or with named references (&rarr;) when one exists.
  • Many emoji are sequences: skin-tone modifiers, zero width joiners, flag letter pairs and variation selectors.
  • One visible emoji can be several code points; use Intl.Segmenter to count what people see.
  • Hide decorative emoji with aria-hidden="true"; label meaningful ones with role="img" and aria-label.
  • Unsupported characters show as empty boxes โ€” prefer common symbols, test widely and keep text fallbacks.

Next: Character Encoding and UTF-8 โ€” how characters become bytes, and why it matters.