Cookies for analytics and advertising
We use cookies for analytics and advertising, both sent to Google. Refusing changes nothing you can see.Read the privacy page
1 GB = 1000000000 B
A gigabyte is 1,000,000,000 bytes in decimal units, which is the number to write when a quota, a lifecycle rule or a limit field wants an integer. Almost every tool that accepts the shorthand 1G means 1,073,741,824 bytes instead, and the 7.4 per cent between those two figures is the difference between a memory limit that holds and one that gets a process killed.
64 GB is 64000000000 B
— a modest phone.
1000 GB is 1000000000000 B
— a drive sold as one terabyte.
0.005 GB is 5000000 B
— a photograph from a phone.
0.000001024 GB is 1024 B
— a kibibyte, which is where the confusion starts.
| GB | B |
|---|---|
| 1 | 1000000000 |
| 2 | 2000000000 |
| 5 | 5000000000 |
| 10 | 10000000000 |
| 50 | 50000000000 |
| 100 | 100000000000 |
| 500 | 500000000000 |
| 1000 | 1000000000000 |
Convert GB to B
A gigabyte is a billion bytes in the decimal sense used by drive manufacturers, phone plans and video sizes.
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.
Going from gigabytes to bytes moves the decimal point 9 places to the right and changes nothing else. There is no factor to remember and no rounding to decide: the digits stay in the same order and only their position changes.
1,234 GB is 1234000000000 B — same digits, moved along. That is worth knowing because it is the one kind of conversion you can check at a glance: if the digits of the answer are not the digits you started with, something other than the conversion has happened to them.
The value this page produces is 1,000,000,000 bytes to the gigabyte, because giga is an SI prefix meaning 10⁹ and that is what storage capacity, network throughput and cloud billing all mean by it. 4 GB is 4000000000, 32 GB is 32000000000, and the conversion is a shift of nine decimal places with no factor involved.
The number it is confused with is 1,073,741,824, which is 1,024³ and properly called a gibibyte. Those two differ by 7.4 per cent — a gap that is trivial in conversation and consequential in a limit field, because limits are enforced exactly. At 4 GB the difference is 294,967,296 bytes: roughly the size of a container image, sitting invisibly between two values that both read as "four gigabytes" in a review.
Nearly every tool that accepts a size shorthand at this scale reads it in powers of 1,024. Docker treats --memory=1g as 1,073,741,824 bytes; the JVM does the same with -Xmx1g and -Xms1g; dd and the wider GNU toolchain distinguish explicitly, with G meaning 1,024³ and GB meaning 1,000³; nginx and PHP size suffixes are binary throughout. A value written as 1G and a value written as 1000000000 are 73,741,824 bytes apart in all of them.
The pattern is worth stating as a rule of thumb rather than memorised tool by tool: a single-letter suffix is binary, and a two-letter suffix ending in B is decimal where the tool bothers to make the distinction at all. When it matters, the safe move is not to trust the rule but to set the value, read it back from the running system, and compare the number reported against the number intended.
Two to the power of thirty-two is 4,294,967,296, and that number is a wall rather than a convention. It is the largest value a 32-bit unsigned offset can hold, so anything that stores a length or a position in 32 bits stops there. The best-known instance is FAT32, where a single file cannot exceed 4,294,967,295 bytes — one byte short — which is why a 5 GB video will not copy onto a memory card straight out of a camera.
The ceiling still appears in places that look modern. Older archive formats, some upload paths, certain database column types and a long tail of drivers and firmware carry 32-bit lengths, and every one of them fails somewhere between 4.29 GB and 4.30 GB rather than at a round decimal figure. When a limit turns out to be 4,294,967,296 exactly, it was not chosen by anybody and raising it is not a configuration change.
Interfaces that act on size at scale take bytes, because bytes are unambiguous and because the action is automated. Object-storage lifecycle rules filter on an object size in bytes; cgroup memory limits are byte values; disk quota tools work in blocks or bytes; alerting thresholds are byte comparisons. There is no rounding step anywhere in that chain, and a value written 7.4 per cent low behaves exactly as if it had been chosen deliberately.
These values also tend to be written once and consulted for years. A lifecycle rule that transitions objects over 128 GB to colder storage will keep doing so long after everyone who chose the threshold has moved on, and the difference between 128000000000 and 137438953472 will quietly change which objects qualify. That is an argument for writing the derivation down at the moment the rule is created rather than for choosing one system over the other.
A deployment manifest routinely specifies memory and storage side by side, and the two industries behind those numbers use the prefix differently. Memory is addressed in powers of two, so a module sold as 16 GB holds 17,179,869,184 bytes and there is no decimal alternative. Storage is sold by capacity, so a volume sold as 1 TB holds exactly 1,000,000,000,000. Written as "4 GB memory, 100 GB disk", those are quantities from two different conventions on adjacent lines.
Which one a platform means for a given field is a documentation question and not a guessable one. Container runtimes and language runtimes generally mean binary units for memory; block storage, object storage and network transfer are generally decimal. When a limit is being set close to an observed requirement, the difference decides whether headroom exists, so it is worth confirming per field rather than per platform.
A memory limit that is 7.4 per cent smaller than intended does not fail on deployment. It fails when the process reaches the top of its normal working range, which happens under load, at a particular time of day, or after a cache has warmed — and it fails as a termination rather than an error, so the logs end mid-sentence with no exception to read. That combination is what makes this specific mistake take days to find rather than minutes.
The defence is to compare intent against the running system rather than against the file. Read the limit back from the platform after applying it, in bytes, and check it against the number you meant. A limit reported as 1073741824 where you wrote 1000000000, or the reverse, has told you which convention the field uses, permanently and for every future value.
Ten digits in a config file are unverifiable at a glance, and a wrong ten digits look exactly like a right ten digits. Where the format is a real language or supports arithmetic, write 4 1024 3 or 4 10 ** 9 and let the expression carry both the size and the system. Where only a literal is permitted, a comment stating the intended size, the convention and the tool it has to agree with does the same job.
It is worth recording why the number is what it is, as well. A memory limit chosen from a profile under peak load and a memory limit chosen because it was the next tier up will be revisited for entirely different reasons, and a value with no stated origin tends to be either raised reflexively or treated as untouchable. One sentence beside it prevents both outcomes.
1,000,000,000 in decimal units, which is what storage manufacturers, networking standards and cloud billing mean. The binary unit holding 1,073,741,824 bytes is the gibibyte, GiB, and it is 7.4 per cent larger. Both numbers are in daily use in infrastructure work, frequently in the same file, and the letters written next to them are not a reliable guide.
Rarely. Docker reads a g suffix on --memory as 1,073,741,824; the JVM reads -Xmx1g the same way; dd and the GNU tools treat G as 1,024³ and reserve GB for 1,000³; nginx and PHP use powers of 1,024 for their size suffixes as well. Writing 1G and writing 1000000000 into the same field asks for two quantities 73,741,824 bytes apart.
4,294,967,296, which is 4 GiB or 4.29 GB. It is the largest value a 32-bit unsigned integer can address, so it turns up as a hard ceiling wherever a 32-bit offset or length survives: the maximum file size on FAT32 is one byte below it, and older APIs, formats and drivers hit the same wall. Nothing about it is configurable.
A memory limit written as 1000000000 where the runtime documentation quotes gibibytes is set 6.9 per cent below what was intended, and a process sized against the intended figure will be terminated near the top of its normal range. The failure looks intermittent because it depends on load, which is what makes this particular mistake expensive to find.
An expression whenever the format allows one. 4 * 1024 ** 3 states both the size and the system it is in and cannot be mistyped without becoming obviously wrong, whereas 4294967296 is ten digits nobody will verify. Where only a literal is accepted, put the derivation in a comment beside it.
Storage is billed decimally — a gigabyte-month is 1,000,000,000 bytes held for a month, and egress is counted the same way. Memory allocations for instances and functions are usually specified in binary units even by the same provider. Reading a bill against a filesystem report requires knowing which of the two produced each number.
One B is 1e-9 GB. 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.
The claims this page makes about data units are checkable, and these are the documents that settle them.
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.