SpunkArt
Front-end and everyday web

How emoji work: code points, sequences and typing them

Every emoji is one or more Unicode characters. The picture you see is drawn by the font on your device, which is why the same emoji looks different on different phones.

An emoji is a number

Unicode gives each character a code point, written as U+ followed by hexadecimal digits. The grinning face is U+1F600. The standard defines the meaning and a reference name; Apple, Google, Microsoft and others draw their own artwork for it. That is why a message can look slightly different on the receiving phone.

Why the length looks wrong

Storage formats count emoji differently, and code that counts characters can give surprising answers. Here is what common formats report, worked out for real examples:

EmojiCode pointsUTF-8 bytesUTF-16 units (JavaScript .length)
A (letter, for comparison)111
😀 grinning face142
👍🏽 thumbs up, medium skin tone284
👨‍👩‍👧 family5188

So in JavaScript, "😀".length is 2, not 1. Code points above U+FFFF need two UTF-16 units, called a surrogate pair. To count what a person sees as one symbol, use a grapheme-aware tool such as Intl.Segmenter in JavaScript.

How emoji combine

Skin tone modifiers

Five modifier characters, U+1F3FB to U+1F3FF, follow a person or hand emoji to set its skin tone. Thumbs up (U+1F44D) plus the medium modifier (U+1F3FD) gives a single medium-tone thumbs up. A device that lacks support shows the two parts side by side.

Zero-width joiner sequences

The zero-width joiner (ZWJ, U+200D) is an invisible character that asks the font to merge its neighbours into one picture. Man + ZWJ + woman + ZWJ + girl draws one family emoji. Breaking the sequence, for example by cutting a string in the middle, leaves separate people.

Presentation selectors

Some older symbols, such as the heart or the sun, exist as plain text characters. Adding U+FE0F, variation selector 16, asks for the colourful emoji style; U+FE0E asks for the plain text style.

How to type an emoji on any device

  • Windows: press Win + . (period) to open the emoji panel, then type a word to search.
  • macOS: press Ctrl + Cmd + Space, or the globe key on newer keyboards.
  • Linux desktops: many have a character or emoji picker app; in GNOME, Ctrl + . works in many text fields.
  • Phones: switch to the emoji keyboard, and use its search box instead of scrolling.
  • HTML: type the emoji directly in a UTF-8 page, or write a numeric reference such as 😀.

Using emoji well in text

  1. Put emoji at the end of a phrase rather than in place of words. Screen readers read the full name, so “Great 👍” is read as “Great, thumbs up”.
  2. Avoid long rows of emoji. Each one is read aloud separately.
  3. Do not rely on an emoji alone to carry meaning in a button or a warning; add a text label.
  4. Check how your text renders on another platform when the emoji is new, since older systems may show an empty box.

Common technical mistakes

  • Truncating a string by UTF-16 length and cutting an emoji in half, which leaves a broken character.
  • Saving text in a database column that uses a three-byte character set. MySQL’s older utf8 type cannot store four-byte emoji; utf8mb4 can.
  • Setting a field length limit in characters on the client but in bytes on the server.

Questions

Who decides which new emoji exist?

The Unicode Consortium approves new emoji as part of new Unicode versions. Device makers then add artwork in their own software updates, so new emoji appear on different devices at different times.

Can I use emoji in a domain name or file name?

Some systems allow it, but support is uneven and they are hard to type, so plain letters remain the safer choice.