Storage Unit Converter — Bytes, KB and KiB Side by Side, Plus the Real Size of a Disk
Type a size such as 1.5 GiB, 500MB or 8e3 KB and it prints the exact byte count next to every decimal and binary unit, shows how a 1 TB drive ends up as 931 GiB, converts a rate like 100 Mbps into how long the download takes, and compares the amount with floppy disks, CDs, DVDs and Blu-ray discs. Everything runs locally in your browser.
| Unit | One unit is | Your size |
|---|
B · How long would transferring it take
One number, two answers
One number, two answers
A hard drive sold as 1 TB is 1012 bytes: manufacturers use the decimal prefixes, where kilo-, mega- and giga- mean 1000, 106 and 109 exactly as they do in physics. The byte count does not change, but a program that divides by 230 and still prints “GB” reports 931. Nothing went missing - that figure is 931 GiB, the binary unit, and the two only look contradictory because different divisions share one label.
Both readings are printed side by side above, since that is the whole answer: “how big is this file” is really “how many bytes”, and the unit is a choice you make afterwards. The gap grows with size:
| Nominal | In binary units | Gap |
|---|---|---|
| 1 KB (1000 B) | 0.977 KiB | 2% |
| 1 MB | 0.954 MiB | 5% |
| 1 GB | 0.931 GiB | 7% |
| 1 TB | 0.909 TiB | 9% |
| 1 PB | 0.888 PiB | 11% |
In practice: drives and SSDs are sold decimal, RAM is binary, Linux ls -lh prints binary, Windows shows a byte count wearing a decimal label, and network speeds are always decimal bits - so a “10 Mbps” line moves at most 1.25 MB/s. That factor of 8 explains most “my download is eight times slower than advertised” reports before any overhead is counted.
How to write the input
A number, an optional space, then a unit. The parser is deliberately narrow:
- Bare number → bytes.
2048is 2048 B. - A single
b→ one bit; a singleB→ one byte.1000bis 125 B. - Sizes ignore case:
mb,MBandMball mean megabytes, andkb,kB,KBall mean 1000 bytes. Strict SI would readMbas megabits, but people type it both ways, so a size is read the way file sizes are meant. - An
ibefore the B selects the binary unit:MiBis 1048576 bytes (Mib,MIBtoo). Noimeans decimal. - Spelled-out bit forms always mean bits:
bit,Mbit,Gbit. - Rates are the exception - there the letter case matters, because it is the only thing distinguishing them:
MB/sis bytes,Mbpsis bits,Gib/sis binary gigabytes per second. A rate written with no marker at all (100M/s) is read as bits, which is how links are quoted. - A per-second unit in the size box is refused, not silently shortened:
100 Mbpsthere would mean “100 megabits”, a different kind of quantity from the one being asked for. The error points at section B. - Scientific notation and digit grouping are fine:
8e3 KB,1,024 MB,-3.5 GiB.
Where the transfer time comes from
bytes × 8 ÷ bits-per-second is the entire calculation, which is exactly why it is labelled ideal. Real transfers run below the stated rate for reasons no converter can know about your link: TCP spends the first round trips ramping its congestion window, TLS handshakes and redirects cost a round trip each, Wi-Fi negotiates a rate it cannot sustain, a “shared” 1 Gbps plan is genuinely shared, a disk can cap out well below the bus speed, and mobile networks throttle bulk transfers while a latency test still looks fine.
The second cell applies a flat 70%, which is roughly where a saturated link on a stable connection lands, just to turn “1 min 49 s” into something nearer “2 min 33 s” and make clear which of the two was optimistic. Treat both as lower bounds. If the actual transfer takes more than about twice this, the link is worth investigating rather than the arithmetic.
The comparison line
“About 3.4 × DVD-5” uses nominal media capacities: a 1.44 MB floppy is 1474560 bytes (1440 KiB, itself a mix of conventions), a data CD holds 700 MiB, a DVD-5 4.7 × 109 bytes, a single-layer Blu-ray 25 × 109. Blank media reserve room for lead-in and error correction, so what you can actually write is a few percent under the label - these are the marketing numbers, meant as a feel for size rather than a burn plan.
Questions
Q: Should I write MB or MiB? For a file’s size in a bug report, use whatever your system shows and say which system showed it. For capacity you are buying, decimal. For link speeds, decimal. MiB is only worth typing when the difference changes a decision - a partition table, an LVM extent, a chunk size.
Q: Why does a bare number mean bytes rather than kilobytes? Byte is the only unit with no division hidden in it, so it is the one reading that cannot be wrong. Every other choice loses information; the exact count is in the first cell.
Q: How exact are these figures? Byte counts are integers up to 253 (about 9 PB), which a double holds exactly, and above that the tool says so instead of pretending. Unit rows are printed with a fixed number of digits, so 1/3 GiB shows as 0.333 GB rather than a full float.
Q: Does what I type get sent anywhere?
Parsing, dividing and formatting are arithmetic inside the script: no eval, and no server is asked to do the maths. What you enter does not leave this device.