Real World Maths Busters

The Maths Behind Everyday Life

The story, the formula and a worked example — see exactly where this maths shows up in the world around you.

Back to all stories
Technology 3 min read

Why One Emoji Can Be 4 Bytes

UTF-8 uses variable-length encoding.

An ASCII letter is 1 byte. An emoji is 4 bytes in UTF-8. A 280-character tweet of emojis is 4× heavier than plain text.

UTF-8 encoding

UTF-8 uses 1–4 bytes per character depending on the code point.

size=∑bytes(ci)\text{size} = \sum \text{bytes}(c_i)

140 ASCII + 140 emojis

  1. 1

    ASCII

    140 × 1 = 140 bytes

  2. 2

    Emojis

    140 × 4 = 560 bytes

  3. 3

    Total

    700 bytes

Answer

2.5× more than a pure ASCII tweet

The formula behind it

Summation

∑i=1nai\sum_{i=1}^n a_i

The takeaway

Every emoji costs four times more storage than a letter.

Back to all stories