Course contentsShow
← Computer Science
Lesson 23 of 2,8721. Digital FoundationsFree lesson

What is Character Encoding?

Understanding why computers need character encoding and how text is represented as numbers.

What is Character Encoding?

What you'll learn: How computers translate text characters into numbers they can store and process.

The Core Problem

You've learned that computers work entirely in binary — everything is stored as 0s and 1s. Numbers like 5 or 42 can be represented directly in binary (101 or 101010). But what about letters? How does a computer store the letter 'A' or the symbol '!'?

The answer: character encoding — a system that assigns each text character a unique number.

How It Works

Think of character encoding like a dictionary that maps letters to numbers:

  • The letter 'A' might be assigned the number 65
  • The letter 'B' might be assigned 66
  • A space character might be 32
  • An exclamation mark '!' might be 33

When you type "HI" on your keyboard, the computer doesn't store the letters themselves. Instead, it looks up each character in the encoding dictionary, finds its assigned number, converts that number to binary, and stores those bits in memory.

When displaying text, the process reverses: the computer reads the binary numbers, converts them back to decimal, looks up which character each number represents, and shows you the letters on screen.

Why This Matters

Without an agreed-upon encoding system, different computers would assign different numbers to the same letters, making communication impossible. If your computer thinks 65 means 'A' but mine thinks it means 'Z', we couldn't share documents!

Key Takeaway: Character encoding is the mapping system that assigns each text character a unique number, allowing computers to store and transmit text using only binary digits.