Skip to content

Unit 6 · Lesson 3

Digital representation of characters

6 steps. Each one is a short story and a question to answer.

When you type the letter A, the computer doesn't see a "letter". It understands only numbers.

So every letter, digit or symbol is given a unique number called a character code.

For example the letter A has code 65, the digit 5 has its own code, and @ has its own.

A character code system is the table fixing each character's number, so the computer stores text as numbers.

Letter A
Code table
Number 65Stored by the computer
Character code = a unique number for each character, and the computer works with numbers

Why do we need a code for each character?

Pick an answer

Character code

Character code = a unique number for each character, and the computer works with numbers. So every letter, digit or symbol is given a unique number called a character code. For example the letter A has code 65, the digit 5 has its own code, and @ has its own.

ASCII code

ASCII = numbers for English letters, digits and symbols, using one byte (256 possibilities). It gives a distinct number to each English letter, capital and small, the digits 0 to 9 and symbols like ! @ # $. It also has control characters that are not printed but control devices.

Converting the word Hello

Letter, then decimal code, then 8 bits, then hex. First, find each letter's code in the ASCII table: H=72, e=101, l=108, o=111. Second, turn each number into 8-bit binary: for example H = 01001000.

The Unicode standard

Unicode = one unified number for every character of every language, stored as UTF-8 or UTF-16. Unicode is a global standard that gives every character in any language a unified number, instead of a different system per language. With 2 bytes (16 bits) it can represent 65,536 characters and symbols.

Encoding and decoding

Encode, store, decode. If the system differs, characters get corrupted. Encoding converts text into character codes using a given system, like Hello to 72 101 108 108 111. Decoding is the reverse: turning the stored numbers back into text a person can read.

Fonts and character codes

The code decides which letter; the font decides its look: serif, sans-serif, semi-cursive. The character code decides which letter it is (65 = A), while the font decides how it looks on screen or in print. Serif: fonts with small strokes at the ends, like Times New Roman. Sans-serif: no strokes and clearer, like Arial.

Done, see the summary
✕

Digital representation of characters

Scroll down ↓ to continue

The lesson on one page

Every idea in the lesson with its rule, ready to screenshot and revise from.

  1. Character code

    Character code = a unique number for each character, and the computer works with numbers

  2. ASCII code

    ASCII = numbers for English letters, digits and symbols, using one byte (256 possibilities)

  3. 3

    Converting the word Hello

    Letter, then decimal code, then 8 bits, then hex

  4. The Unicode standard

    Unicode = one unified number for every character of every language, stored as UTF-8 or UTF-16

  5. Encoding and decoding

    Encode, store, decode. If the system differs, characters get corrupted

  6. 6

    Fonts and character codes

    The code decides which letter; the font decides its look: serif, sans-serif, semi-cursive

Test yourself

One question from every step. Answer and see your score.

Question 1 of 6

Why do we need a code for each character?

Watch and listen

Quick reel

Unit 6

Learn how a computer understands letters: character codes, ASCII, Unicode, encoding and decoding, why text sometimes breaks, and font types, in an animated explainer.

Share this lessonWhatsApp

The lesson in writing

The same explanation as the 3D scene, written out for quick review.

Character code

Character code = a unique number for each character, and the computer works with numbers. So every letter, digit or symbol is given a unique number called a character code. For example the letter A has code 65, the digit 5 has its own code, and @ has its own.

Page 104

ASCII code

ASCII = numbers for English letters, digits and symbols, using one byte (256 possibilities). It gives a distinct number to each English letter, capital and small, the digits 0 to 9 and symbols like ! @ # $. It also has control characters that are not printed but control devices.

Page 104, 105

Converting the word Hello

Letter, then decimal code, then 8 bits, then hex. First, find each letter's code in the ASCII table: H=72, e=101, l=108, o=111. Second, turn each number into 8-bit binary: for example H = 01001000.

Page 106, 108

The Unicode standard

Unicode = one unified number for every character of every language, stored as UTF-8 or UTF-16. Unicode is a global standard that gives every character in any language a unified number, instead of a different system per language. With 2 bytes (16 bits) it can represent 65,536 characters and symbols.

Page 109, 110

Encoding and decoding

Encode, store, decode. If the system differs, characters get corrupted. Encoding converts text into character codes using a given system, like Hello to 72 101 108 108 111. Decoding is the reverse: turning the stored numbers back into text a person can read.

Page 110, 111

Fonts and character codes

The code decides which letter; the font decides its look: serif, sans-serif, semi-cursive. The character code decides which letter it is (65 = A), while the font decides how it looks on screen or in print. Serif: fonts with small strokes at the ends, like Times New Roman. Sans-serif: no strokes and clearer, like Arial.

Page 111, 113

Questions about this lesson

What is a character code?
A unique number assigned to each letter, symbol or digit so the computer can store and process it, because computers understand only numbers.
What is ASCII?
A system representing English capital and small letters, digits and symbols with numbers. It uses one byte (8 bits), so 256 possibilities, and it does not support Arabic.
What is Unicode?
A global standard giving every character in any language a unified number instead of a separate system per language. It is stored using UTF-8 or UTF-16.
Why does text sometimes turn into strange symbols?
When the encoding used to save the text differs from the decoding used to read it, the text looks garbled. The fix is using the same encoding system for saving and reading.