Turning a long byte count into a label figure
File properties, command-line tools and programming languages report sizes in bytes, a long number that is hard to compare with the capacity on a box. This page divides by one billion to give the decimal gigabyte, the unit on storage products. The default of 10 bytes gives 1e-8 GB, only to check the arithmetic. Practical inputs have nine to twelve digits. A single-layer DVD holds about 4,700,000,000 bytes, or 4.7 GB. A video file of 1,500,000,000 bytes is 1.5 GB, and a drive sold as 500 GB has 500,000,000,000 bytes. The conversion is a division with no rounding unless you choose to round the answer.
Giga in the SI and the binary alternative
The BIPM SI Brochure defines giga as 10^9, and NIST SP 811 states that this meaning applies when the prefix is used with the byte. A binary gibibyte, written GiB, is 2^30, which is 1,073,741,824 bytes, about 7.4 percent more. The IEC introduced the binary prefixes so that each symbol would have one meaning. Storage manufacturers use the decimal gigabyte, and some operating systems display binary sizes under the label GB, which creates a gap between the capacity on the box and the figure in the file manager. The page title says decimal to mark which one it computes. The prefix gap compounds at each step, so a terabyte drive is about 9 percent smaller than the binary tebibyte, and the mismatch is larger for big devices than for small ones.
Why a 500 GB drive shows as 465 GB
A drive with 500,000,000,000 bytes is 500 GB in decimal terms. A system that divides by 1,073,741,824 shows 465.66, and often prints it as 465 GB, though the correct unit is GiB. No capacity is missing. The same bytes are being counted with a larger unit. On this page, select GB as the source and GiB as the target with the value 500 to see 465.661, and 1 TB to GiB gives 931.323. The gap grows with the prefix: about 2.4 percent for kilo, 4.9 percent for mega, 7.4 percent for giga and 10 percent for tera. File system overhead then takes a little more. Formatting a drive reserves space for the allocation tables and journal, so a freshly formatted 500 GB drive shows slightly less than 465 GiB free. Neither the decimal rounding nor the formatting overhead is a defect, and the drive manufacturer is counting the same bytes you are.
Phones, memory cards and downloads
Phone and card capacities are sold in decimal gigabytes, and operating system reports mix both. A phone with 128 GB of storage has 128,000,000,000 bytes, and after the operating system takes its share, the free space shown is lower still. A download of 3,200,000,000 bytes is 3.2 GB. A game update of 12.5 GB is 12,500,000,000 bytes, which at a 50 Mbps connection, 6,250,000 B/s, takes 2,000 seconds, about 33 minutes. Converting bytes to gigabytes puts all of these on the scale you use for planning. Photo and video libraries make a good example. A 12 megapixel photo of 4,000,000 bytes means 250 photos per gigabyte, so a 128 GB phone holds roughly 32,000 such photos if nothing else is stored, and 4K video at a bitrate of 60 Mbps uses 27 GB per hour, from 7,500,000 B/s times 3,600 seconds.
Monthly data and cloud billing
Mobile plans, cloud storage and transfer fees are billed in gigabytes, and some providers use the decimal and others the binary meaning. A plan with a 5 GB allowance is 5,000,000,000 bytes in the decimal sense and 5,368,709,120 in the binary sense, a difference of 368,709,120 bytes. Over a month, a user near the limit could see a different overage depending on which is used. Read the provider terms, which usually define the unit. When they do not, assume the stricter decimal figure for your own planning, and check the meter you are actually billed on.
From gigabytes to bytes and to binary units
Select GB as the source to get bytes: 2 GB is 2,000,000,000 bytes, and 1.5 GB is 1,500,000,000. Selecting GiB as the target shows the binary equivalent, such as 1 GiB being 1.073741824 GB. Programmers allocating memory should work in bytes or binary units, because memory comes in powers of two. A request for 4 GB of address space in the decimal sense is 4,000,000,000 bytes, which is less than the 4 GiB, 4,294,967,296 bytes, that a 32 bit address can reach. The distinction explains several well-known memory limits. RAM modules are labeled in gigabytes but are built in powers of two, so a module sold as 16 GB holds 16 GiB, or 17,179,869,184 bytes, which is 17.18 decimal gigabytes. Memory is the main place where the label uses the binary meaning, while disks use the decimal one.
Rounding sizes honestly
Sizes in a file manager are rounded, and rounding hides differences. A file of 1,049,999,999 bytes is 1.05 GB, and one of 1,050,000,000 is also 1.05 GB. For billing or quotas compare bytes. When writing about capacity, give the decimal figure with its unit and say whether you counted formatted space. Rounding up is common for download sizes, and rounding down for free space, so that the user is not surprised. State the rule you use in the report if the figures matter.
Checking the result
A quick check divides by 1,000 three times. Move the decimal point nine places to the left: 4,700,000,000 becomes 4.7. If the answer looks a thousand times too large or too small, a prefix has slipped, and you may have used megabytes or terabytes. If it is about 7 percent off from a figure in your system, the system is probably using gibibytes. The page is exact, so differences come from the unit definitions. Keep the byte count in your records, because it can be converted to any unit later. The reverse check also works: multiply the gigabyte answer by one billion and confirm that you recover the original byte count, which catches a misplaced digit in the input. Spreadsheet users can reproduce the page with a single formula that divides the cell by 1E9, and checking one known value such as 4,700,000,000 against the page confirms the formula before it is copied down a long column.