Data Size Units Explained
Data sizes often get confusing because of bit vs byte, decimal vs binary prefixes, and uppercase vs lowercase B/b. This page collects the common units and how to read them at a glance.
๐ Size Basics
Start with the smallest units and essential conversions.
bit vs byte
- ๐ค bit (b) is the smallest unit, 0 or 1. It shows up in network speed notations (bps).
- ๐ค byte (B) is 8 bits. File sizes and memory capacities are usually counted in bytes.
- ๐ค nibble (4 bits) equals one hexadecimal digit and sometimes appears in bit-field explanations.
Quick conversions
| Unit | Conversion | Note |
|---|---|---|
| 1 bit | Either 0 or 1 | Smallest piece of information |
| 1 byte | 8 bits | Often 1 ASCII character; UTF-8 uses 1 to 4 bytes per character. |
| 1 KB (decimal) | 1,000 bytes (10^3) | Decimal kilo; common in vendor specs. |
| 1 KiB (binary) | 1,024 bytes (2^10) | Binary kibi; common in memory/filesystem contexts. |
| 1 MB (decimal) | 1,000,000 bytes (10^6) | Decimal megabyte, often used in storage marketing. |
| 1 MiB (binary) | 1,024 KiB โ 1.05 MB | Binary mebibyte; avoids ambiguity. |
๐งฎ Prefixes and Notation
Decimal (SI) vs binary (IEC) prefixes differ slightly in value.
Decimal vs binary
Storage specs often use decimal (GB) while memory tools show binary (GiB). The same โ1Gโ can mean different numbers depending on context.
| Notation | Base | Value | Typical usage |
|---|---|---|---|
| kB / MB / GB | Decimal | 1kB = 1,000B 1GB = 1,000,000,000B |
Drive/SSD marketing, advertised data transfer amounts |
| KiB / MiB / GiB | Binary | 1KiB = 1,024B 1GiB = 1,073,741,824B |
OS memory readouts, filesystem block sizes |
| KB / MB (mixed) | Depends on product | Often decimal, but varies by device/software | Settings or manuals that avoid clear definitions |
Tips to avoid misreading
- ๐ Check both the letter case (B/b) and the prefix (k/Ki) together.
- ๐ Look for notes like โ1MB = 10^6 bytesโ or โ1KB = 1024 bytesโ in specs.
- ๐ For reproducible measurements (images, memory dumps), stick to binary units (MiB/GiB).
โ ๏ธ Reading Common Specs
Speed and capacity use different units; avoid mixing them up.
Network speed in bps
- ๐ 1 Gbps = 1,000,000,000 bit/s. In bytes that is 1,000,000,000 รท 8 โ 125 MB/s.
- ๐ Uppercase B (B/s) means bytes per second; lowercase b (bps) means bits per second.
- ๐ Protocol overhead (TCP/IP, TLS, etc.) reduces the achievable throughput further.
Storage capacity labels
- ๐พ A โ512GBโ drive from vendors usually means decimal 512,000,000,000B; OS tools show about 476GiB.
- ๐พ Decide as a team whether to calculate with GiB or GB when estimating capacity.
- ๐พ Cloud pricing pages may mix GB and GiB; always check the billing unit footnotes.
๐ก Practical Rules of Thumb
Keeping a few back-of-the-envelope conversions in mind speeds up troubleshooting.
Handy conversions
- โ 1MiB โ 1.05MB. 100MB (decimal) is about 95.4MiB.
- โ 1Gbps theoretical max is ~125MB/s; 10Gbps is ~1.25GB/s.
- โ A 10MB file on a 100Mbps link transfers in roughly 0.8 seconds (before overhead).
Logging and UI practices
- ๐ Store raw counts as integer bytes in logs/DB and convert to human units on display.
- ๐ Always show โvalue + unitโ together in the UI and spell out prefixes (GiB/GB).
- ๐ APIs benefit from an explicit unit field to prevent downstream confusion.