Byte Size Conversion: KB, KiB, and the Missing Gigabytes
After reading this you will know why a "500 GB" drive shows 465 in your file manager, how to convert between decimal and binary units by hand, and which unit each part of your system actually uses.
The one number that never matches
You buy a drive labeled 500 GB. You plug it in, and your operating system reports something like 465 GB. Nothing is broken, and nothing was stolen. The two numbers describe the same physical bytes using two different definitions of the letters "GB".
The drive maker counts in powers of 1000. To them, 500 GB means 500 \times 1000^3 = 500{,}000{,}000{,}000 bytes. Your OS counts in powers of 1024 but prints the same three-letter label. It takes that identical byte count and divides by 1024^3:
Same bytes, two rulers. The Byte Size Converter shows you both rulers side by side and always prints the exact byte count in the middle, so you can see where the gap comes from.
Two families of units
The confusion has a fix that most software ignores. Since 1998 the IEC standard 60027-2 (later folded into ISO/IEC 80000-13) defines a separate set of binary prefixes. The decimal prefixes keep their SI meaning of powers of 1000. The binary prefixes get a small "i" and mean powers of 1024.
- Decimal (SI) units
KB,MB,GB,TB. Each step multiplies by 1000. Used by storage vendors, network speeds, and anything measured in SI.- Binary (IEC) units
KiB,MiB,GiB,TiB, pronounced "kibibyte", "mebibyte", "gibibyte". Each step multiplies by 1024. Used for RAM and file sizes at the OS level.
The trap is that Windows and many older tools compute in powers of 1024 but print the SI labels KB, MB, GB. So the number is binary, the label is decimal, and you cannot tell which meaning applies without knowing the tool.
macOS switched to decimal units in 2009 (Snow Leopard). A file that macOS calls 1 GB will show as about 0.93 GB in Windows for exactly the same bytes. Linux tools vary: ls -l gives raw bytes, ls -lh gives binary with an M suffix, and df -H gives decimal.
The formula and the intuition
Every conversion routes through one honest number: the total byte count. To go from a unit to bytes, multiply by that unit's size. To go from bytes to a unit, divide.
Here value is the number you typed, B is the base (1000 for decimal, 1024 for binary), and n is the step count (1 for kilo, 2 for mega, 3 for giga, 4 for tera). To convert between two units, get to bytes first, then divide out the target unit.
The drift between the two families grows with each step because you are comparing 1024^n against 1000^n. One step is 1024/1000 = 1.024, a 2.4% gap. Three steps compound it:
So a "gigabyte" of binary is about 7.37% larger than a decimal gigabyte, and a "terabyte" of binary is about 10% larger. That compounding is why the missing space looks worse on bigger drives.
Worked example: 500 GB drive
Reproduce the demo defaults: enter 500 as GB.
- Convert to bytes using base 1000, step 3: 500 \times 1000^3 = 500{,}000{,}000{,}000 bytes.
- Now express those bytes in
GiBusing base 1024, step 3: divide by 1024^3 = 1{,}073{,}741{,}824. - 500{,}000{,}000{,}000 \div 1{,}073{,}741{,}824 \approx 465.66 GiB.
- Windows prints that same 465.66 but labels it
GB. That is the number you see in the drive properties.
The 34.34 "gigabytes" that seem to vanish were never storage. They are the difference between two labeling conventions for the identical 500,000,000,000 bytes.
Reading the converter output
The tool always prints three things: your input, the exact integer byte count, and the equivalent in every other unit. Trust the byte count. It is the only value with no ambiguity. The unit rows are just that byte count divided by different constants.
| Bytes | Decimal label | Binary value | Binary label |
|---|---|---|---|
| 1,000 | 1 KB | 0.9766 | KiB |
| 1,024 | 1.024 KB | 1 | KiB |
| 1,048,576 | 1.049 MB | 1 | MiB |
| 500,000,000,000 | 500 GB | 465.7 | GiB |
Notice that 1,024 bytes is exactly 1 KiB but 1.024 KB. Whenever a value looks slightly above a round number in one column, it is landing exactly on a round number in the other.
When decimal, when binary
You do not get to choose the unit family freely. Each domain has a fixed convention, and mixing them produces wrong answers.
- RAM is always binary. A
16 GBmemory stick is 16 \times 1024^3 = 17{,}179{,}869{,}184 bytes. Memory addressing is inherently powers of two, so there is no decimal version. - Storage is sold decimal. Drives, SSDs, and SD cards use powers of 1000 on the box.
- Network speed is decimal bits. A
100 Mbpslink is 100 \times 1000^2 = 100{,}000{,}000 bits per second, which is 12.5 megabytes per second (divide by 8, then note bytes vs bits). - File sizes at the OS level are usually binary, though the label depends on the OS as noted above.
Bits and bytes are a separate trap on top of the 1000 versus 1024 trap. Network speeds use bits (lowercase b, as in Mbps); file sizes use bytes (uppercase B). A byte is 8 bits, so a 100 Mbps connection downloads at most about 12.5 MB per second, not 100.
Common mistakes
Three errors cause almost every byte-size bug.
- Assuming the label tells you the base. A
MBfrom Windows is really a mebibyte. AMBfrom a drive vendor is a real megabyte. Same label, different math. - Using 1024 in code that reports "MB". If your program divides by
1024*1024and prints "MB", it is lying by 4.86% at that step. Either divide by1000*1000, or print "MiB". - Confusing bits and bytes in transfer estimates. Dividing a file size in megabytes by a link speed in megabits without the factor of 8 makes downloads look 8 times faster than reality.
Related tools
Byte counting shows up whenever you measure encoded data. If you are sizing a payload before transport, the Base64 / URL / HTML Encoder-Decoder helps you see the roughly 33% size increase Base64 adds. To measure the byte length of text specifically, including multibyte UTF-8 characters, use the String Length Inspector. When you hash a file or verify a signature, the Hash Generator and HMAC Calculator work on the same underlying bytes this converter counts, and the JWT Decoder shows how those bytes get Base64url-packed into a token.
Frequently asked questions
Why does my 1 TB drive show as 931 GB?
1 TB is 10^{12} bytes. Divided by 1024^3 that is about 931.32 GiB, which Windows labels "GB". No space is lost; it is the same 1,000,000,000,000 bytes read on the binary ruler.
Is a kilobyte 1000 or 1024 bytes?
Officially 1000, per SI and IEC 80000-13. The 1024 value belongs to the kibibyte (KiB). In everyday speech people say "kilobyte" for both, which is exactly why the confusion persists.
Why is RAM never labeled in GiB even though it is binary?
Habit and marketing. RAM sizes have always been powers of two, so 16 GB of RAM genuinely means 16 GiB. The industry kept the shorter GB label. Storage, being sold decimal, made the mismatch visible.
How do I convert a network speed to a download time?
Convert the file to bits (multiply bytes by 8), then divide by the link speed in bits per second. A 1 GB file over 100 Mbps: 8 \times 10^{9} bits divided by 10^{8} bits per second equals 80 seconds, before any overhead.
Which unit should I use in my own software?
Pick one and label it honestly. If you divide by 1024, print KiB/MiB. If you divide by 1000, print KB/MB. The bug is not the choice; the bug is dividing by 1024 and printing MB.