Wirebook

Wirebook › Bonus lesson

Why do emojis turn into boxes, question marks or gibberish?

Bonus lesson · about 6 minutes · hands-on · nothing you type leaves your browser

You send a friend a pizza emoji and they see a little empty box. Or a string of strange letters like ðŸ•. Or a family that has fallen apart into three separate people. Did someone steal your emojis? Put on your detective hat: this lesson shows what an emoji really is (a number, not a picture) and solves four crime scenes where emojis seemed to vanish.

Emoji X-ray

Type or paste anything with emojis in it. The X-ray shows the secret numbers inside each one and how many bytes it takes to send. Everything happens in this page; nothing you type is sent anywhere.

0things you see
0secret numbers (code points)
0bytes to send (UTF-8)
0"length" some apps count

    An emoji is a number with a name

    Computers only store numbers, so every letter, digit and emoji in the world has been given its own number by a club called the Unicode Consortium. Capital A is number 65 (written U+0041). The pizza is number 127,829 (U+1F355). When you send a pizza, your phone doesn't send a picture: it sends that number, packed into four bytes using a code book called UTF-8.

    Your friend's phone then looks the number up in its own emoji font and draws its own picture. That's why the same emoji looks a bit different on different phones: each company has its own artists. It also means the picture can go wrong at the far end, even though the number arrived perfectly.

    Some emojis are several numbers stuck together. A thumbs up with a skin tone is the thumbs-up number plus a skin-tone number. A family is a man, a woman and a girl joined by invisible zero width joiners: glue characters that say "draw these as one picture if you can". Flags are two special letters (G and B make 🇬🇧).

    The case of the vanishing emojis

    Someone sent this message: Four phones and computers received it, and each one shows something different. For each scene, pick the real culprit.

      The four usual suspects

      Glue your own emoji

      Pick a person, a skin tone and a job. Watch them join into one emoji, then switch on "old phone" to see the glue fail.

      Why does a single emoji use up two (or eleven) characters? Many apps count "characters" in 16-bit chunks, a leftover from when people thought 65,536 numbers would be enough for every symbol in the world. Emojis live above that, so each one takes two chunks, and a glued-together family takes eight or more. That's why a text box with a limit can fill up surprisingly fast with emojis. Try it in the X-ray above.

      Keeping your emojis safe

      Building apps? Grown-up help pages on Tooltern: emoji shows as a box (tofu), mojibake (ðŸ / é gibberish), and MySQL Incorrect string value / utf8mb4. For a JSON X-ray from a script, try Anvil's free /v1/text/inspect (graphemes, code points, UTF-8/16 lengths, invisible characters). For a full detective case where a cat gets framed, try who stole the emojis?. Also try ghost footprints for passwords and filenames that look identical but hide invisible characters. Tooltern pages stay in your browser; the API never stores what you send.

      Related: why one emoji can turn a single text into two (in the text-message lesson).

      Words from this lesson

      Earn a bonus badge

      Get all 3 right to collect the Vanishing emojis bonus badge. Bonus badges are extra: they don't change your stamp count or rank. Wrong answers are fine: just try again.

      1. What does your phone actually send when you send a pizza emoji?

      2. Your friend sees an empty box where your newest emoji should be. What's the most likely reason?

      3. Why does a family emoji sometimes show up as three separate people?

      Try another lesson

      1. 3Can a website get tired?7 min · interactive
      2. 12How does a game remember where you got to?6 min · interactive
      3. 1What happens when you open a web page?6 min · interactive