What is a Byte
A byte is 8 bits — the fundamental unit of computer memory. A single bit is a 0 or a 1. Group eight of them together and you get a byte, which can represent 256 distinct values (2^8). Every character you type, every pixel on your screen, and every instruction your CPU executes is ultimately stored and processed as bytes.
How it works
A bit can be either 0 or 1. A byte combines 8 bits into a single addressable unit. When you hear that a computer has "16 gigabytes of RAM," that means it has roughly 16 billion bytes of memory, each with its own unique address.
Bytes encode information through agreed-upon schemes:
- ASCII uses one byte per character. The letter
Ais byte value 65 (binary01000001). This covers 128 characters — enough for English text and basic symbols. - UTF-8 uses one to four bytes per character. English characters still take one byte, but characters from other writing systems or emoji use more. The character
ewith an accent takes two bytes. A Chinese character takes three. - Integers use fixed byte widths. A 32-bit integer is 4 bytes, holding values up to about 4.3 billion. A 64-bit integer is 8 bytes.
Memory is byte-addressable on modern hardware. The CPU doesn't fetch individual bits — it reads and writes in byte-sized (or larger) chunks. When you ask for the value at memory address 0x1000, you get the byte stored there.
Why it matters
The byte is the bridge between abstract data and physical memory. When you learn about the stack, the heap, and virtual memory, everything is measured in bytes. Understanding that a pointer is 8 bytes on a 64-bit system, or that a UTF-8 string is a sequence of variable-length byte encodings, makes memory layouts and performance trade-offs concrete rather than abstract.
See How Memory Works for the full picture of how bytes are organized into stacks, heaps, and pages.