UTF-8, UTF-16, UTF-32: Encoding Methods

Test yourself on Character Sets with exam style questions, marked instantly.

Flashcards that come back just before you would forget them.

A revision plan that remembers what you know and shows what to do next.

See which topics you have nailed and which need another look.

Quiz yourself on Character SetsGet your flashcardsBuild my revision planTrack my progress

UTF-8, UTF-16, UTF-32: Encoding Methods

Unicode Transformation Formats (UTF):

Unicode defines WHAT each character's code is. UTF defines HOW to store those codes in bytes.

UTF-8 (Most Common):

  • Variable length: 1 to 4 bytes per character
  • ASCII compatible: ASCII characters still use 1 byte (efficient!)
  • English text: 1 byte per character (same size as ASCII)
  • Accented letters: 2 bytes (é, ñ, ü)
  • Chinese/Japanese: 3 bytes per character
  • Emoji: 4 bytes
  • Advantages: Efficient for English, backward compatible with ASCII
  • Disadvantage: Asian languages take 3× more space than UTF-16

UTF-16:

  • Variable length: 2 or 4 bytes per character
  • Most characters: 2 bytes (including Chinese, Japanese, Korean)
  • Emoji & rare: 4 bytes (surrogate pairs)
  • Use case: Windows internals, Java, JavaScript strings
  • Advantage: Efficient for Asian languages
  • Disadvantage: English takes 2× space vs ASCII/UTF-8

UTF-32:

  • Fixed length: Exactly 4 bytes per character (always)
  • Advantage: Simple - every character same size, easy indexing
  • Disadvantage: Wastes space - 'A' takes 4 bytes (0x00000041)
  • Use case: Internal processing where speed > space

Make this stick

Signing in gives access to all PrepWise features.

PrepWise is a trading name of A3M Quality Solutions Limited, registered in England and Wales, company number 14959172. Registered office: 202 Stroud Road, Gloucester, GL1 5LA. ICO registration ZC267069.