The byte count behind the label

Operating systems, hypervisors and memory tools describe sizes in GiB, but the programs that allocate storage deal in bytes. A virtual machine configured with 8 GiB asks the hypervisor for 8,589,934,592 bytes. A database page cache of 2 GiB is 2,147,483,648 bytes. This page gives the exact integer so you can compare it with a byte count in a log, a configuration file or an error message. It is the direct route from a human-friendly label to the number that code uses, and no rounding is needed anywhere in the process.

Two to the thirtieth power

The IEC prefix gibi stands for 2 to the power 30, which is 1,073,741,824. NIST SP 811 and IEC 80000-13 list it alongside kibi and mebi. The page computes B = GiB × 1,073,741,824. The default 10 GiB returns 10,737,418,240 bytes. One GiB is 1,024 MiB and 1,048,576 KiB, so the factor equals 1,024 cubed. Because the factor is an integer and a power of two, quarter and half gibibytes convert to exact integers as well: 0.25 GiB is 268,435,456 bytes and 0.5 GiB is 536,870,912.

Familiar power-of-two milestones

Several byte counts mark limits in software. A signed 32-bit integer holds values up to 2,147,483,647, one byte short of 2 GiB, so a file of exactly 2 GiB, which is 2,147,483,648 bytes, does not fit in a signed 32-bit size field. An unsigned 32-bit integer tops out at 4,294,967,295, one byte short of 4 GiB. These limits explain why old tools failed on files of two or four gibibytes. Entering 2 and 4 on this page returns the exact thresholds, and a developer can compare them with the limit of a data type.

Reading byte counts back as GiB

Select bytes as the source and gibibytes as the target to divide by 1,073,741,824. A figure of 1,000,000,000 bytes returns about 0.9313226 GiB, and 1,000,000,000,000 bytes returns about 931.3226 GiB. That is why a drive sold as 1 TB shows about 931 in tools that count in binary units. A log entry that reports 6,442,450,944 bytes of memory returns exactly 6 GiB. Use this direction when a tool prints raw bytes and you want a size that you can say aloud and compare with a hardware label. A crash dump that reports 17,179,869,184 bytes of committed memory is 16 GiB exactly, while 16,000,000,000 bytes would be 14.9 GiB, so the exact byte count tells you at once whether a process hit a 16 GiB limit or a decimal 16 GB one. That kind of check matters when you decide whether a container was killed by its memory cap or by something else.

Configuration values and typos

Settings files often accept a byte count with no unit. If you want a 3 GiB limit, the value is 3,221,225,472, and a missing digit or an extra one changes the limit by ten times. Computing the integer with this page and pasting it avoids the mistake. Some tools accept suffixes, such as G or Gi, and the meaning of the letter differs between them: Gi is binary, G in some tools is decimal. Kubernetes resource quantities are a well-known case, where 1Gi means 1,073,741,824 bytes and 1G means 1,000,000,000 bytes, a gap of nearly 74 million bytes per unit. A manifest that requests 8G of memory therefore asks for about 6.9 percent fewer bytes than one that requests 8Gi, and a pod sized with the wrong suffix can be killed earlier than its owner expects. Read the documentation, and when in doubt use the full byte count, which has no ambiguity.

Pages, blocks and alignment

Memory is managed in pages, and a 4 KiB page is 4,096 bytes. One GiB therefore contains 262,144 pages of that size. With 2 MiB huge pages, a GiB holds 512 of them. Allocation sizes in storage systems are also multiples of the block size. These counts come from dividing the byte total on this page by the page or block size. A size that is not a multiple of the page size is rounded up by the system, so a request for 1,073,741,825 bytes occupies 262,145 pages. Allocators add their own bookkeeping, and a process that asks for exactly 1 GiB usually ends up with a larger footprint in the system monitor. Compare the monitor figure in bytes with the converted request to see how much overhead you are paying.

Display limits for large values

The page shows up to twelve significant digits. Results for inputs up to about 900 GiB fit within that limit as exact integers, and larger inputs show a rounded display. For exact arithmetic on very large sizes, use integer math in code. A 1 TiB size is 1,024 GiB and 1,099,511,627,776 bytes, which has thirteen digits and exceeds the display. State the unit in each cell of a table, and use digit grouping for readability, so that 10,737,418,240 does not turn into 10737418240 in a way that hides the count of digits.

Decimal sizes alongside binary ones

A size in gibibytes and a decimal figure in gigabytes describe different byte counts. Ten GiB is 10,737,418,240 bytes, and ten GB is 10,000,000,000. The difference is 737,418,240 bytes, which is about 703 MiB. Installers and download pages that mix the two can leave readers puzzled by a mismatch of that size. The page shows the binary side exactly. If your source is decimal, use the gigabyte option instead, and if the source is ambiguous, ask for a byte count, which settles the question. A purchase order that lists 64 GB of RAM can be checked the same way: 64 GiB is 68,719,476,736 bytes, and 64 GB is 64,000,000,000, so the two readings differ by more than four billion bytes.

Worked sizing example for a cache

A service keeps records of 512 bytes each in memory and has a budget of 6 GiB. The budget is 6,442,450,944 bytes, which holds 12,582,912 records of 512 bytes before any overhead. If each record carries 64 bytes of bookkeeping, the per-record cost is 576 bytes and the budget holds about 11,184,810 records. Doing the sum from bytes avoids the rounding that creeps in when you approximate a gibibyte as a billion bytes: with 1,000,000,000 bytes per GiB the same budget would appear to hold 6 percent fewer records than it really can. The page supplies the exact byte count.