Convert GiB to B

GiB
1073741824B

1 GiB = 1073741824 B

One gibibyte is 1,073,741,824 bytes, so converting GiB to bytes is a multiplication by 2³⁰. That is the number a configuration field wants when it refuses a suffix, and it is also what a G suffix silently expands to in the JVM, in Docker, in systemd and in most of the tools that read a memory limit.

  • Where it runs In your browser. The number you type is never part of a request.
  • Exact by definition 1 GiB is exactly 1073741824 B — a definition, not a rounded factor.
  • Answers as you type No button, no wait. The worked answer is already on the page before any script runs.

Gibibyte to Byte in practice

  • 8 GiB is 8590000000 B

    — the memory in a mid-range laptop.

  • 931 GiB is 999700000000 B

    — what Windows reports for a one-terabyte drive.

  • 0.004657 GiB is 5000000 B

    — a photograph from a phone.

  • 9.537e-7 GiB is 1024 B

    — a kibibyte, which is where the confusion starts.

Gibibyte to Byte at a glance

Every figure here is computed from the same definition the calculator uses, so the table cannot drift away from the answer above it.
GiBB
11073741824
22147483648
55368709120
1010737418240
5053687091200
100107374182400
500536870912000
10001073741824000

Gibibyte and Byte

A gibibyte is 1,073,741,824 bytes — about 7% more than a gigabyte. Windows measures in gibibytes and labels them GB, which is the whole of the missing-space mystery.

A byte is eight bits, though that was not always fixed — early machines used six, seven or nine. The eight-bit byte won because it holds one character of text and divides neatly in half.

A gibibyte is exactly 1,073,741,824 bytes

Going this way is a multiplication, and by a whole number: one gibibyte is 1,073,741,824 bytes, exactly, and 1,073,741,824 is the definition rather than a measurement that came close.

That makes it one of the few conversions worth doing in your head, and it makes the answer checkable: divide back and you must land on the number you started with, exactly, with no remainder to explain away.

GiB is the binary one

One GiB is 1,024 of the unit below it; one GB is 1,000. On this page that is the difference between 1073741824 B and 1000000000 B — 7.4 % — and the gap grows at every step up the scale, which is why it is a rounding error on a photograph and a visible chunk of a hard disk.

This is the whole of the missing-storage mystery, and on this page it is worth 7.4 %. A drive sold in GB holds exactly what the label says; Windows divides by 1,024 instead of 1,000, keeps the decimal name, and reports 1000000000 B where the box said 1073741824. macOS has counted these in the decimal units since 10.6, which is why the same drive can look two sizes on two machines — nothing is missing and nobody is rounding, the same bytes have two names.

The raw count a configuration field is asking for

Plenty of settings take a number and no unit, and the documentation says bytes. An object storage part size, a request body limit in an application framework, a buffer size in a database configuration, a quota in an API call: all of them want an integer, and the integer for one gibibyte is 1,073,741,824. Multiply by the gibibyte figure and the answer is exact, because both units are defined counts and nothing is being approximated.

The reason to reach for the binary unit rather than a round decimal number is that the surrounding system is almost certainly binary already. Memory pages, block sizes, buffer allocations and address ranges are powers of two, and a limit of 1,000,000,000 bytes sits awkwardly between two of them. A limit of 1,073,741,824 lines up with the allocator underneath it, which is why the tools that let you write a suffix expand it that way.

A G suffix that looks decimal and is not

The convention across operational tooling is that a bare k, m or g means 1,024, 1,048,576 or 1,073,741,824. The JVM heap flags work that way, so -Xmx4g reserves 4,294,967,296 bytes. Docker memory and storage limits work that way. So do the systemd resource directives and the size values in nginx. None of these announce it in the value itself; the letter looks like an SI prefix and behaves like a binary one.

The GNU coreutils go one step further and accept both spellings, with a rule that is easy to state and easy to forget: a single letter is binary and a two-letter form ending in B is decimal. dd bs=1G copies in blocks of 1,073,741,824 bytes and dd bs=1GB copies in blocks of 1,000,000,000. The two commands look almost identical in a shell history and differ by seven per cent in every block they move.

Kubernetes is the system that says which one it means

Resource quantities in Kubernetes carry the distinction in their syntax. A suffix of Gi is binary, so 1Gi is 1,073,741,824 bytes; a suffix of G with no i is decimal, so 1G is 1,000,000,000. The same holds at every scale — Ki against k, Mi against M, Ti against T — and the manifest means precisely what it says with no tool-specific convention to look up.

That clarity has a sharp edge. A memory limit written 4G rather than 4Gi is 294,967,296 bytes smaller, which is a difference of about seven per cent and entirely invisible in review. Where a workload sits close to its ceiling, that single missing letter is the difference between a pod that runs and a pod that is killed for exceeding its limit at a busy moment.

The powers of two worth recognising on sight

A handful of byte counts turn up repeatedly in error messages and limit fields, and knowing them saves a conversion. 1,048,576 is a mebibyte, 1,073,741,824 is a gibibyte, 2,147,483,648 is two of them, and 4,294,967,296 is 2³² — the exact size of a 32-bit address space, and the ceiling a 32-bit process cannot allocate past however much memory the machine has.

One short of those figures matters as much as the figures themselves. 2,147,483,647 is the largest signed 32-bit integer, and any byte count carried in one stops there. A file that uploads at 1.9 GiB and fails at 2.1 is usually meeting that boundary rather than a configured limit, and no amount of raising the configured limit will move it.

Where a mis-sized limit fails loudly and where it does not

Loud failures are the fortunate case. A container that exceeds its memory limit is killed with a recognisable status; an upload above a body-size limit is rejected with a status code that names the problem. Both point at the setting that caused them, and the fix is a single edit once the byte count has been worked out correctly.

The quiet failures cost more. A heap sized seven per cent above what the container will allow does not fail at startup — it fails weeks later, under load, when the process finally tries to use the memory it was told it had. A cache limit set in the wrong unit does not error at all; it evicts more often than intended, and the only symptom is a hit rate slightly lower than the design predicted.

Write the arithmetic, not only the constant

A configuration line reading 8589934592 tells a reviewer nothing about intent. The same value written as 8 1024 1024 * 1024 where the format permits an expression, or annotated with a comment saying eight gibibytes, is checkable at a glance. Every large byte constant in a repository is a number somebody will eventually have to verify, and the ones that carry their own derivation are the ones that survive a refactor intact.

Where the syntax allows a suffix, prefer it over the expanded digits. Nearly every typo in 1Gi is a syntax error, and the one that is not — dropping the i — costs seven per cent; a typo in 1073741824 is a working configuration with a limit ten times too large or too small. That asymmetry is the whole argument for suffixes, and it is why the tools that adopted them rarely go back.

The binary units above the gibibyte

The sequence continues by factors of 1,024: a tebibyte is 2⁴⁰, or 1,099,511,627,776 bytes, and a pebibyte is 2⁵⁰, or 1,125,899,906,842,624. Both appear in limits rather than in measurements — maximum object sizes, maximum file sizes, address space ceilings — because those are the places where somebody had to pick a power of two and write it down.

The ceiling that matters most in practice sits above all of them. An unsigned 64-bit byte count reaches 16 EiB, which no current system approaches, so byte counts in modern code do not overflow. What they do instead is lose precision when they pass through a layer that stores numbers as floating point, and that happens around 8 PiB — far below the type limit and far above anything a single configuration value will ever hold.

Confirming what the limit actually became

Whatever was written, read the effective value back from the system rather than trusting the file. Container runtimes expose the memory ceiling they applied, the JVM will print its resolved heap settings on request, and most servers report their parsed configuration. The number that comes back is in bytes, and comparing it against 1,073,741,824 times the figure you intended is a two-second check that catches every unit mistake at once.

This matters most where two layers each impose a limit in a different unit. A process limit written in gibibytes inside a container whose limit was written in decimal gigabytes leaves a gap of seven per cent that nobody planned, and the smaller of the two wins silently. Reading both back in bytes puts them on the same scale and makes the ordering obvious.

Convert GiB to B: common questions

What is 1 GiB in bytes?

1,073,741,824 bytes, which is 2 to the power of 30. Two gibibytes is 2,147,483,648, four is 4,294,967,296 and eight is 8,589,934,592. Each of these is a power of two and each one shows up as a limit somewhere, which is why they are worth recognising on sight.

Does -Xmx4g in the JVM mean four billion bytes?

No. The JVM size suffixes are binary, so 4g is 4 GiB, or 4,294,967,296 bytes. The same applies to k and m in that setting. A heap sized against a decimal assumption is 7.4 per cent larger than the operator intended, which is enough to matter on a container with a hard memory ceiling.

What is the difference between Gi and G in Kubernetes?

Kubernetes accepts both and means different things by them: 1Gi is 1,073,741,824 bytes and 1G is 1,000,000,000. It is one of the few systems that makes the distinction explicit in its own syntax, which also means a typo of one letter changes a limit by 7.4 per cent without any warning.

Which tools treat a G suffix as binary?

The JVM heap flags, Docker memory and storage limits, systemd resource directives, nginx size directives and the GNU coreutils in their default mode all treat a bare G as 2³⁰. GNU tools additionally accept GB for 10⁹, so `dd bs=1G` and `dd bs=1GB` are different block sizes.

Why does a limit near 2 GiB behave strangely?

Because 2,147,483,647 is the largest value a signed 32-bit integer holds, and a byte count stored in one caps a byte short of 2 GiB. Software that predates 64-bit size fields, or that passes sizes through a protocol with a 32-bit length, tends to fail at exactly that boundary rather than at any round decimal figure.

Is it safe to write 1073741824 rather than 1Gi?

It is unambiguous, which is the main thing, but it is harder to review. Where the tool accepts a binary suffix, the suffix is clearer and cannot be mistyped by a digit. Where it does not, writing the multiplication in a comment beside the constant costs nothing and saves the next person from counting zeros.

Going the other way: Byte to Gibibyte

One B is 9.31323e-10 GiB. It is the same relationship read backwards, so an answer from one page put through the other has to come back to where it started.

Where these figures come from

The claims this page makes about data units are checkable, and these are the documents that settle them.

How this page works

The factor is a constant in the page and the arithmetic is four operations, so nothing is sent anywhere and nothing needs to be. The number you type never leaves the browser — there is no request for it to travel in.