💻 Computer Science · Topic 15 of 80

Text and Character Encoding

Characters are stored as numbers using ASCII or Unicode.

Interactive labClick bits to count in binary

About this topic

Computers store text as numbers using a character encoding, an agreed table that links each character to a number. ASCII uses 7 bits to represent 128 characters, such as letters, digits and punctuation, so A is 65 and a is 97. Unicode is a much larger system covering most of the world's writing systems and emoji, and UTF-8 is its most common form.

The need for a shared standard is crucial. If a sender and receiver use different tables, text turns into garbage characters, known as mojibake. Unicode solves this by giving every character a unique code point. UTF-8 stores common English letters in one byte, keeping it compatible with ASCII, but uses up to four bytes for other symbols.

For example, the word Hi is stored as 72 and 105, or 01001000 01101001 in binary. Because capital and lowercase letters differ by 32, computers can change case easily. A common misconception is that the computer sees letters; it only sees numbers, and the font decides how the shape is drawn. Another is that the digit character 5 and the number 5 are the same; the character 5 is code 53 in ASCII.

Key ideas

  1. A is 65 in ASCII
  2. Unicode covers every language
  3. UTF-8 is common

Quick check

Use cases: where Text and Character Encoding helps

Computing ideas run phones, search engines, games and the wider internet.

Frequently asked questions

What is Text and Character Encoding?

Characters are stored as numbers using ASCII or Unicode.

What will I learn in Text and Character Encoding?

A is 65 in ASCII. Unicode covers every language. UTF-8 is common.

Is Text and Character Encoding part of Computer Science?

Yes. It is one of 80 Computer Science topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.

Does the Text and Character Encoding lab work on a phone or tablet?

Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.

How should I study Text and Character Encoding?

Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.

Do I need an account, and is my progress saved?

No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.

More in Computer Science