Rationale

There are two ways to represent big numbers: You could either display them in multiples of 1000 = 10 3 (base 10) or 1024 = 2 10 (base 2). If you divide by 1000, you probably use the SI prefix names, if you divide by 1024, you probably use the IEC prefix names. The problem starts with dividing by 1024. Many applications use the SI prefix names for it and some use the IEC prefix names. The current situation is a mess. If you see SI prefix names you do not know whether the number is divided by 1000 or 1024. There is already a Brainstorm idea for it: Fix file size confusion.

Policy

Applications must use IEC standard for base-2 units: 1 KiB = 1,024 bytes (Note: big k) 1 MiB = 1,024 KiB = 1,048,576 bytes 1 GiB = 1,024 MiB = 1,048,576 KiB = 1,073,741,824 bytes 1 TiB = 1,024 GiB = 1,048,576 MiB = 1,073,741,824 KiB = 1,099,511,627,776 bytes

Applications must use SI standard for base-10 units: 1 kB = 1,000 bytes (Note: small k) 1 MB = 1,000 kB = 1,000,000 bytes 1 GB = 1,000 MB = 1,000,000 kB = 1,000,000,000 bytes 1 TB = 1,000 GB = 1,000,000 MB = 1,000,000,000 kB = 1,000,000,000,000 bytes

It is not allowed to use the SI standard for base-2 units: 1 kB != 1,024 bytes KB (with a big k) does not exist



Implementation

There are two ways to fix the abuse of the SI standard for base-2:

Correct the application to divide by 1,000 and keep on using SI prefixes. Correct the application to keep on dividing by 1,024 but use the IEC prefixes.

Correct basis

Use base-10 for:

network bandwidth (for example, 6 Mbit/s or 50 kB/s)

disk sizes (for example, 500 GB hard drive or 4.7 GB DVD)

Use base-2 for:

RAM sizes (for example, 2 GiB RAM)

For file sizes there are two possibilities:

Show both, base-10 and base-2 (in this order). An example is the Linux kernel: "2930277168 512-byte hardware sectors: (1.50 TB/1.36 TiB)" Only show base-10, or give the user the opportunity to decide between base-10 and base-2 (the default must be base-10).

Exception

The application can keep their previous behavior for backwards compatibility if the following points apply. The application may add an option to display the sizes in base-10, too.

is a command-line tool

is often parsed by machine (for example, the output is used in scripts)

only the prefix is displayed and not the unit (for example, M instead of MB)

Some applications which fall under this rule are:

df

du

ls

Use cases

Alice does not know much about computers. She is familiar with the SI prefix system (1 kg = 1000 g, 1 km = 1000 m). She quickly understands that 1 kB is 1000 bytes.

Bob uses Ubuntu and Windows. He wants to see the same numbers for file sizes in Nautilus as in Windows Explorer so that he can simply compare them. Therefore, Nautilus needs to display the file sizes in base-2.

Bug reports

Tag bugs that violate this policy with units-policy.

Additional notes

There is no third "standard" in the form of the O'Reilly Style Guide. It only specified abbreviations for 1,024 (K) and 1,000 (k), but not for 1,048,576 and 1,000,000 and so on.

Bugs in this policy

These devices are labelled in a way that this policy fails to account for:

CD-ROM sizes are specified in MiB, but the manufacturers label this "MB" (a "700 MB" CD-ROM contains approximately 700 MiB = 737 MB).

Memory (RAM, ROM) is specified in base 2, but labelled with SI prefixes. For example, a "512 MB" RAM contains 512 MiB = 536.9 MB.

Most small floppy disks are measured in base 2, but labelled with SI prefixes.

A floppy labeled with "1.44 MB" contains 1.44 x 1000 x 1024 bytes = 1.41 MiB = 1.47 MB, which doesn't follow either convention.

References

General

Brainstorm ideas and blueprints

Other operating systems

Debian: Consistent Unit Prefixes

How Mac OS X reports drive capacity - "In Mac OS X v10.6 Snow Leopard, storage capacity is displayed as per product specifications (base 10). A 200 GB drive shows 200 GB capacity ..."