Binary represents all data

Everything is Binary

Inside every computer, every piece of data and every instruction is stored and processed as binary - sequences of 0s and 1s. A single binary digit is called a bit. Bits are grouped into larger units: 8 bits form a byte, and bytes can be grouped further into kilobytes, megabytes, and beyond.

The reason computers use binary is physical: electronic circuits have two reliable states - a voltage is either present (1) or absent (0). Binary maps perfectly onto these two states. No other number system can be represented so directly and reliably in hardware.

The crucial insight is that binary is not a type of data - it is a universal encoding system. The same sequence of bits can represent completely different things depending on how the system is instructed to interpret it. A byte such as 01000001 could be the integer 65, the letter A, a pixel colour value, or part of a sound sample - the bits themselves do not carry a label. Context and encoding rules determine meaning.

Binary Representing Different Types of Data

The tabs below show how binary encodes four different categories of data. For each category, two distinct real-world contexts are shown to illustrate that the principle applies broadly - not just in one narrow setting.

Integers

Whole numbers are stored as binary values. Each additional bit doubles the range of values that can be represented: 8 bits can store values from 0 to 255; 16 bits can store values from 0 to 65,535.

  • Context 1 - Game score: a player's score of 200 is stored as 11001000. When the score increases, the binary pattern changes accordingly.
  • Context 2 - Sensor reading: a temperature sensor outputs a binary value such as 00011110 to represent 30 degrees. The microcontroller reads this binary pattern and converts it to a usable value.

Text

Characters are encoded using agreed standards that map each symbol to a unique binary pattern. The most common standard is ASCII, which uses 7 or 8 bits per character. Unicode extends this to cover thousands of characters from many languages.

  • Context 1 - Typing a message: pressing the key 'A' on a keyboard sends the binary pattern 01000001 (ASCII value 65) to the computer. Every character in a document is stored as a corresponding binary pattern.
  • Context 2 - Web page content: every letter, space, and punctuation mark on a web page is transmitted across the internet as binary data. The receiving device uses the agreed encoding to reconstruct the visible text.

Images

A digital image is made up of a grid of pixels. Each pixel is represented by one or more binary values describing its colour. In a simple black-and-white image, 1 bit per pixel is sufficient (0 = black, 1 = white). In colour images, multiple bytes per pixel describe the intensity of red, green, and blue components.

  • Context 1 - Digital photograph: a single pixel in a colour photograph might be stored as three bytes - one each for red, green, and blue intensity. A value of 11111111 00000000 00000000 would represent pure red.
  • Context 2 - QR code: a QR code is a binary image where each black or white square directly encodes a 0 or a 1. The entire pattern is a visual representation of binary data that a camera can read.

Sound

Sound is a continuous wave, but computers store it digitally by sampling: measuring the amplitude (height) of the sound wave at regular intervals and recording each measurement as a binary number. The more bits used per sample, the more precisely the original sound can be represented.

  • Context 1 - Music streaming: a song stored as an MP3 or WAV file is a sequence of binary samples taken thousands of times per second. When played back, the device reconstructs the original waveform from these binary values.
  • Context 2 - Voice assistant: when a voice assistant records speech, a microphone converts sound waves into electrical signals, which are then sampled and encoded as binary numbers. Those binary values are processed to recognise words.

 Key Takeaways

  • All data inside a computer - text, images, sound, numbers, and instructions - is stored and processed as binary (sequences of 0s and 1s).
  • Computers use binary because electronic circuits have exactly two reliable physical states: on (1) and off (0).
  • A single binary digit is a bit; 8 bits make a byte. Larger units (KB, MB, GB) are multiples of bytes.
  • The same binary pattern can represent different types of data depending on how it is interpreted. The bits themselves carry no label - context and encoding rules give them meaning.
  • Instructions that tell the CPU what to do are also stored in binary, following the same principle as all other data.