Code unit
A code unit is the basic component used by a character encoding system (such as UTF-8 or UTF-16). A character encoding system uses one or more code units to encode a Unicode code point.
A **code unit** is the basic component used by a character encoding system (such as UTF-8 or UTF-16). A character encoding system uses one or more code units to encode a Unicode code point.
In UTF-8, each code point is encoded using between one and four 8-bit code units.
In UTF-16, each code point is encoded using one or two 16-bit code units.
## See also
- Code point
- UTF-8
- UTF-16
- [Unicode encoding FAQ](https://www.unicode.org/faq/utf_bom.html)
source: MDN Web Docs mirror · page
Cite this
"Code unit". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Glossary/Code_unit