Menu
Coddy logo textTech

What Is a Bit?

A bit, short for binary digit, is the smallest unit of data in computing and holds one of two values, 0 or 1. Computers store and process all information, from numbers and text to images and programs, as sequences of bits.

By Kevin Spektor, Co-founder & CTO

Updated September 24, 2026

4
2
1
Value5
Different values2^3 = 8
Range0 … 7

Each bit you add doubles the number of values. Eight bits make a byte: 256 values, 0 to 255.

A light switch is either off or on. A bit is the same idea written as a number: 0 or 1. One bit can answer a single yes or no question, but put bits side by side and each extra bit doubles the number of patterns they can form. Eight of them are enough for any letter on a keyboard, and billions of them hold a film.

How a bit is stored

A bit is anything with two states that hardware can set and read back reliably. Different devices use different physical effects:

  • Processor: a wire or transistor at a high or a low voltage.
  • RAM: a tiny capacitor in each memory cell that is either charged or empty.
  • Hard disk: a small region of the disk magnetized in one direction or the other.
  • Flash memory (SSDs, USB sticks): electric charge trapped in a cell. Modern flash stores 3 or 4 bits in one cell by using several charge levels.

Two states are used instead of ten because two are easy to tell apart even when the signal is noisy. A circuit only has to decide whether a voltage is high or low, not which of ten levels it is closest to.

How bits count

Bits count in binary, base 2. Each position is worth twice the one to its right: 1, 2, 4, 8, 16 and so on. The bits 1101 mean 8 + 4 + 0 + 1, which is 13.

With n bits there are 2ⁿ different patterns, so every added bit doubles the range:

 1 bits -> 2 values
 2 bits -> 4 values
 4 bits -> 16 values
 8 bits -> 256 values
16 bits -> 65,536 values
32 bits -> 4,294,967,296 values
64 bits -> 18,446,744,073,709,551,616 values

Those numbers show up everywhere. A color channel stored in 8 bits has 256 shades, which is why RGB values run from 0 to 255. An IPv4 address is 32 bits, so there are about 4.3 billion of them, and IPv6 moved to 128 bits for that reason. A signed 32-bit integer tops out at 2,147,483,647, and adding 1 to it in Java wraps around to -2,147,483,648.

Python converts between numbers and their bits with bin() and int(), and the number base converter does the same in the browser:

0b1101
13
4 bits needed
0b100
0b111
0b1001
0b1100

Working with individual bits

The operators in the second half of that example are bitwise operators. They work on each bit position separately: & (and) keeps a bit only where both numbers have it, | (or) keeps it where either has it, ^ (xor) keeps it where exactly one has it, and << and >> shift all bits left or right. C, Java, JavaScript and Python all use the same symbols.

Programs use them to pack several yes or no settings into one number, one bit per setting. Unix file permissions work this way: read, write and execute are three bits, so 7 (binary 111) means all three and 5 (binary 101) means read and execute. That is what chmod 755 sets. Each of those settings is a boolean, and one bit is all a boolean needs.

Bits in text

Text is stored as numbers, and numbers as bits. Each character has a code, and the code is written in binary:

H 72 01001000
i 105 01101001
! 33 00100001

Each character here takes 8 bits, one byte. ASCII needs only 7 bits per character, but computers store it in whole bytes. The text to binary converter shows the bits for any text you type.

Bits in everyday numbers

Two familiar numbers are counted in bits. Internet speeds are measured in bits per second: a 100 Mbps connection moves 100 million bits each second, which is 12.5 megabytes per second, because file sizes are measured in bytes of 8 bits. The lowercase b in Mbps means bits and the uppercase B in MB means bytes; the byte page compares the two units in full.

The other is the "64-bit" label on processors and operating systems. It is the size of the numbers and memory addresses the processor works with in one step.

Bits also catch errors. A parity bit is one extra bit added to a group so that the count of 1s is always even. If a single bit flips on the way, the count becomes odd and the receiver knows the data is damaged. A checksum extends the same idea to whole files.

Where the word comes from

"Bit" is short for binary digit. Claude Shannon used it in his 1948 paper "A Mathematical Theory of Communication" and credited the word to John Tukey. In Shannon's information theory, one bit is also a measure: the amount of information in the answer to a question with two equally likely outcomes, such as a fair coin toss.

Where to go next

Bits are almost always handled eight at a time, so read what a byte is next, including the bit vs byte comparison. What a boolean is shows how a single bit of meaning, true or false, drives the decisions in a program, and what a checksum is shows how bits detect corrupted data.

Frequently Asked Questions

What is a bit in a computer?
A bit in a computer is a single 0 or 1, stored as one of two physical states, such as a high or low voltage in a circuit or a charged or empty memory cell. Everything a computer holds, including numbers, text, images and programs, is made of bits. Eight bits together form a byte.
Why is it called a bit?
Bit is a contraction of binary digit. The word is credited to the statistician John Tukey, and it first appeared in print in Claude Shannon's 1948 paper "A Mathematical Theory of Communication", which founded information theory.
What is a bit in money?
In old American usage, a bit is one eighth of a dollar, or 12.5 cents, so "two bits" means a quarter. The term comes from the Spanish silver dollar, which could be cut into eight pieces. It is unrelated to the computing bit, which is a binary digit.
What does 32-bit or 64-bit mean?
It describes how many bits a processor handles in one step and uses for memory addresses. A 32-bit address can point to 2^32 bytes, which is 4 GiB, so 32-bit systems cannot use more memory than that directly. Current desktop and phone processors are 64-bit, which raises that limit far beyond any installed memory.
What is the difference between a bit and a qubit?
A bit is always exactly 0 or 1. A qubit, the unit of a quantum computer, can be in a superposition of 0 and 1 until it is measured, and measuring it gives 0 or 1 with certain probabilities. Qubits are used for specific quantum algorithms and do not replace bits in ordinary computers.
Coddy programming languages illustration

Learn to code with Coddy

GET STARTED