Bits and bytes
There are 8 bits in a byte. This guide explains what a bit and a byte are, how much each can hold, and how kilobytes, megabytes and their binary cousins compare.
How many bits in a byte?
8. One byte is 8 bits. The US National Institute of Standards and Technology (NIST) writes it as 1 B = 23 bit = 8 bit. Half a byte, 4 bits, is often called a nibble, and it is exactly one hex digit.
What is a bit?
A bit, short for binary digit, is the smallest piece of data a computer stores: a single 0 or 1. On its own a bit can answer one yes-or-no question. Put bits together and the number of possible patterns doubles with every bit you add.
| Bits | Different patterns | Whole numbers it can hold |
|---|---|---|
| 1 bit | 2 | 0 to 1 |
| 2 bits | 4 | 0 to 3 |
| 4 bits | 16 | 0 to 15 |
| 8 bits | 256 | 0 to 255 |
| 16 bits | 65,536 | 0 to 65,535 |
| 32 bits | 4,294,967,296 | 0 to 4,294,967,295 |
What is a byte?
A byte is a group of 8 bits. It has 28 = 256 patterns, so it holds a number from 0 to 255. That is enough for one ASCII character: the letter “A” is the byte 01000001, which is 65.
Most data is measured in bytes. Text in UTF-8 uses one byte for each basic English letter and two to four bytes for other characters, which is why “é” takes two bytes and most emoji take four. The text to binary converter shows the bytes of anything you type.
Numbers bigger than 255 need several bytes, and computers disagree about which byte comes first. That is called endianness.
64 + 1 = 65 = A
Bit or byte? b and B
The symbol for byte is a capital B; bits are written out as “bit”, and you will often see a small b. Internet speeds are usually given in bits per second (Mbit/s or Mbps), while file sizes are given in bytes. To turn a speed in bits into bytes, divide by 8: a 100 Mbit/s connection moves at most 12.5 megabytes each second.
Kilobyte or kibibyte: 1,000 or 1,024?
The metric prefixes kilo, mega and giga mean powers of 10: a kilobyte is 1,000 bytes. Because 210 = 1,024 is close to 1,000, “kilobyte” was long also used to mean 1,024 bytes. To end the confusion, the International Electrotechnical Commission (IEC) approved separate binary prefixes in December 1998: kibi, mebi, gibi and so on, written KiB, MiB and GiB.
| Decimal (SI) | Size | Binary (IEC) | Size |
|---|---|---|---|
| 1 kilobyte (kB) = 103 | 1,000 bytes | 1 kibibyte (KiB) = 210 | 1,024 bytes |
| 1 megabyte (MB) = 106 | 1,000,000 bytes | 1 mebibyte (MiB) = 220 | 1,048,576 bytes |
| 1 gigabyte (GB) = 109 | 1,000,000,000 bytes | 1 gibibyte (GiB) = 230 | 1,073,741,824 bytes |
| 1 terabyte (TB) = 1012 | 1,000,000,000,000 bytes | 1 tebibyte (TiB) = 240 | 1,099,511,627,776 bytes |
The gap grows with size: a gibibyte is about 7% bigger than a gigabyte. This is why a drive sold as 1 TB (1012 bytes) can show up as about 931 GiB in software that counts in binary units.
Sources and method
- NIST, Prefixes for binary multiples: the IEC binary prefixes (kibi, mebi, gibi …) approved in December 1998, with 1 B = 8 bit. Checked 2026-11-25.
- RFC 20 (STD 80), ASCII format for network interchange, section 4: the 128 ASCII codes and control-character names. Checked 2026-11-25.
- RFC 3629 (STD 63), UTF-8, a transformation format of ISO 10646, section 4: which byte sequences are valid UTF-8. Checked 2026-11-25.
Questions
How many bits are in a kilobyte?
8,000 bits in a kilobyte of 1,000 bytes, or 8,192 bits in a kibibyte of 1,024 bytes.
How many bytes is one character?
One byte for each ASCII character, such as English letters, digits and common punctuation. In UTF-8 other characters take two to four bytes.
What is bigger, a bit or a byte?
A byte. It is 8 bits.
What is a nibble?
Four bits, or half a byte. One nibble is exactly one hexadecimal digit, 0 to F.