How Computers Read: An Introduction to Binary and Text
Have you ever wondered how your computer, which is essentially a machine running on electricity, understands the words you are reading right now? The answer lies in a simple system of switches: Binary Code.
The Language of 0s and 1s
At its core, a computer processor is made up of billions of tiny transistors. These transistors act like light switches—they can either be ON or OFF.
- ON is represented by the number 1.
- OFF is represented by the number 0.
This base-2 number system is called Binary. Unlike our decimal system (base-10) which uses digits 0-9, binary only uses 0 and 1. But by combining these two digits, we can represent any number, and eventually, any piece of information.
Interactive Demo: Bits as Switches
Click the light bulbs below to turn them ON (1) or OFF (0) and see how they add up to make a decimal number.
Bits vs. Bytes
You often hear about Megabytes (MB) or Gigabytes (GB). These are units of measurement for data.
- Bit: A single binary digit (0 or 1).
- Byte: A group of 8 bits.
Why 8? Because 8 bits can represent 256 different values (28), which is enough to cover all standard letters, numbers, and symbols in English. This is why one character of text typically takes up one Byte of storage.
From Numbers to Text: The Need for a Map
Computers are great at math, but they don't inherently understand letters like 'A', 'B', or 'C'. To display text, early computer scientists created a mapping system—a code that assigns a unique number to every character.
1. ASCII: The Early Standard
The most famous early system is ASCII (American Standard Code for Information Interchange). It uses 7 bits (or 8 bits/1 byte) to represent characters.
'B' = 66 (Decimal) = 01000010 (Binary)
'a' = 97 (Decimal) = 01100001 (Binary)
This worked great for English, but what about other languages? ASCII only had room for 128 (or 256) characters, which wasn't enough for Chinese, Arabic, or even accented European letters.
More ASCII Examples:
- Space = 32 =
00100000 - ! = 33 =
00100001 - @ = 64 =
01000000
2. Unicode: The Universal Standard
To solve this, Unicode was created. Unicode is a massive list that assigns a unique number to virtually every character in every human language—and even emojis! 🌍
Most of the web today uses a Unicode encoding called UTF-8. It's clever because it's compatible with the old ASCII system but can expand to use more bytes for complex characters.
Try It Yourself
Understanding the theory is one thing, but seeing it in action is better. You can use our Binary Translator tool to type in your name and see exactly how a computer sees it in binary code.
For example, the word "Hi":
i = 01101001
Result: 01001000 01101001
Beyond Text: Images and Colors
Binary isn't just for text. Every photo on your phone is also stored as 0s and 1s. In images, binary codes represent colors instead of letters.
For example, a pixel's color is often defined by three numbers (Red, Green, Blue). In binary, a pure Red pixel might look like this:
Green: 00000000 (0)
Blue: 00000000 (0)
Too Many 0s and 1s? Meet Hexadecimal
Reading long strings of binary can be dizzying. That's why computer scientists often use Hexadecimal (Base-16). It's a shorthand way to write binary code.
If you want to learn how to shrink binary strings, check out our Binary to Hex Converter.
Conclusion
So, the next time you send a text message or write an email, remember that behind the scenes, your device is rapidly processing millions of 0s and 1s, translating your human thoughts into machine language and back again.