How Binary Code Works

From microscopic transistor switches to the words on your screen — the full journey

Layer 1: The Transistor — A Tiny Switch

At the bottom of the stack is the transistor. A modern CPU contains about 10 billion of them, each smaller than a virus. A transistor has three terminals: source, gate, and drain. Apply voltage to the gate, and current flows from source to drain — the transistor is ON (representing 1). Remove voltage, current stops — OFF (representing 0). A single transistor is a 1-bit memory cell. Arrange a few transistors together and you get a logic gate.

Layer 2: Logic Gates — AND, OR, NOT

Combine transistors in specific patterns, and you create logic gates. An AND gate outputs 1 only when both inputs are 1. An OR gate outputs 1 when either input is 1. A NOT gate flips its input. These three gate types are universal — every digital circuit ever built can be constructed from them. An adder circuit (which adds two binary numbers) uses about 30 transistors. A complete CPU is just billions of these tiny circuits layered and interconnected.

Layer 3: The CPU — Fetch, Decode, Execute

The Central Processing Unit is a machine that repeatedly does three things: fetch an instruction from memory (as binary), decode what the instruction means (add, subtract, move data, compare), and execute it. A 3 GHz processor does this cycle 3 billion times per second. All instructions and data are binary. The CPU does not "know" it is adding numbers or processing text — it just manipulates binary patterns according to its instruction set.

Layer 4: Encoding — ASCII and Unicode

Raw binary numbers need meaning. ASCII assigns numbers 0-127 to characters: 65 = 'A', 97 = 'a', 48 = '0'. When a program reads binary value 01000001 from memory and interprets it as text, it displays 'A'. If the same binary value is interpreted as a number, it displays 65. If interpreted as a color, it is a dark blue pixel. The binary is the same — only the interpretation changes. Modern systems use UTF-8, which extends ASCII to support every world language while remaining backward-compatible. Try our binary translator to type text and see the binary equivalent in real time.

Layer 5: Your Screen — Pixels to Perception

The final step: binary values in video memory become colored pixels on your screen. Each pixel is 24 bits — 8 for red, 8 for green, 8 for blue. A 1920×1080 screen has 2 million pixels × 24 bits = 48 million bits per frame. At 60 frames per second, your GPU processes nearly 3 billion bits every second. All of it started as 0s and 1s in transistors. That is how binary code works — a chain of interpretation from physics to perception, each layer adding meaning to the binary that came before it.