= Code unit
A <code unit> is the basic fixed-width storage unit of a <character encoding> form. <UTF-8> uses eight-bit <code units>; <UTF-16> uses sixteen-bit <code units>. A <code point> can require several <code units>.<The Unicode Standard Version 17 Core Specification>[§3.9, D77 and Unicode encoding forms]{ref}
For example, `U+1F600` uses four <code units> in <UTF-8>, `F0 9F 98 80`, and two in <UTF-16>, `D83D DE00`, with values written in <hexadecimal>. Cutting after one <code unit> can therefore split an encoded <code point>. A <grapheme cluster> can itself contain several <code points>, adding another reason that storage length and displayed-character count differ.
Back to article page