The Language of Computers
Explore the foundation of all digital technology: the binary system. Learn how 0s and 1s power everything from smartphones to supercomputers.
Binary Basics
Binary is a base-2 number system that uses only two digits: 0 and 1. Unlike our familiar decimal system (base-10) which uses ten digits (0-9), binary represents all values using just these two symbols.
In computing, these binary digits (or "bits") correspond to the two possible states in digital electronics: OFF (0) and ON (1). This makes binary the perfect language for computers, which operate using electronic switches that can be either off or on.
Why Binary?
- It's simple and reliable - only two states to manage
- It maps perfectly to electronic circuits (voltage on/off)
- It enables error detection and correction
- It forms the foundation for all digital data storage and processing
Binary Numbers
In binary, each position represents a power of 2, starting from the rightmost digit (2⁰ = 1) and increasing as you move left (2¹ = 2, 2² = 4, 2³ = 8, etc.).
| Position | 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
|---|---|---|---|---|---|---|---|---|
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Example (42) | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
So the binary number 00101010 equals 32 + 8 + 2 = 42 in decimal.
Try It Yourself
Convert between decimal and binary:
Text in Binary
To represent text in binary, computers use character encoding systems like ASCII (American Standard Code for Information Interchange) or Unicode. Each character is assigned a unique number, which is then converted to binary.
ASCII Encoding
In ASCII, each character is represented by a 7-bit binary number (0-127). For example:
| Character | ASCII Value | Binary |
|---|---|---|
| A | 65 | 1000001 |
| B | 66 | 1000010 |
| a | 97 | 1100001 |
| 1 | 49 | 0110001 |
| space | 32 | 0100000 |
Modern computers typically use UTF-8 (a Unicode encoding), which can represent virtually any character from any language, including emojis. UTF-8 uses a variable number of bytes per character.
Convert Text to Binary
Try converting your own text to binary:
How It Works
Each character in text is converted to its ASCII/Unicode value, then that value is converted to binary. For example, the letter 'A' has an ASCII value of 65, which in binary is 01000001. When converting binary to text, the process is reversed.
Binary in Action
Computer Memory
RAM, hard drives, and SSDs all store data as binary. A single byte (8 bits) can represent 256 different values (2⁸). Modern storage devices contain billions or trillions of these binary cells.
Digital Images
Each pixel in a digital image is represented by binary values for color and brightness. For example, in RGB color, each pixel typically uses 24 bits (8 bits each for red, green, and blue).
Digital Audio
Sound waves are sampled thousands of times per second, with each sample converted to a binary number. CD-quality audio uses 16 bits per sample at 44,100 samples per second.
Computer Processors
CPUs execute instructions encoded in binary. These instructions tell the processor what operations to perform, from basic arithmetic to complex data manipulation.