Convert GB to MiB

GB
953.674316406MiB

1 GB = 953.674316406 MiB

One gigabyte is 953.674 mebibytes, because a GB is a billion bytes and a MiB is 1,048,576 of them. Entering a GB figure into a panel or an alert rule that expects MiB without that conversion puts the threshold about 5 percent away from where it was meant to sit.

  • Where it runs In your browser. The number you type is never part of a request.
  • Exact by definition 1 GB is exactly 953.674316406 MiB — 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.

Gigabyte to Mebibyte in practice

  • 64 GB is 61040 MiB

    — a modest phone.

  • 1000 GB is 953700 MiB

    — a drive sold as one terabyte.

  • 0.7371 GB is 703 MiB

    — a data CD, which is 700 MB on the label.

  • 0.008389 GB is 8 MiB

    — a chunk of memory a program might allocate.

Gigabyte to Mebibyte 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.
GBMiB
1953.674316406
21907.34863281
54768.37158203
109536.74316406
5047683.7158203
10095367.4316406
500476837.158203
1000953674.316406

Gigabyte and Mebibyte

A gigabyte is a billion bytes in the decimal sense used by drive manufacturers, phone plans and video sizes.

A mebibyte is 1,024 kibibytes, or 1,048,576 bytes. Linux tools and memory sizes generally mean this even when they print "MB".

What it costs to round the factor

The factor is 953.674316, and almost nobody carries that around. Rounded to 950 it is off by 0.39 % — which stays invisible on small numbers and turns into a whole unit somewhere around 1,000 GB.

That is the number worth knowing before you round: not the error itself, but where it stops being ignorable. Below that point the shorter factor is the sensible one; above it, use the field above, which never rounds until it prints.

MiB is the binary one

One MiB is 1,024 of the unit below it; one MB is 1,000. On this page that is the difference between 0.001 GB and 0.001 GB — 4.9 % — 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 4.9 %. A drive sold in MB holds exactly what the label says; Windows divides by 1,024 instead of 1,000, keeps the decimal name, and reports 0.001 GB where the box said 0.001. 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.

Why a GB is 953.674 MiB and not 1,000

A gigabyte is a billion bytes. A mebibyte is 1,048,576. Divide one by the other and you get 953.67431640625, exactly and with no rounding — a number nobody would guess and everybody has to look up. The instinct is to reach for either 1,000, which is the MB in a GB, or 1,024, which is the MiB in a GiB, and both are wrong here because the pair crosses between the two systems.

The size of the error depends on which wrong number you pick. Using 1,000 overstates by 4.9 percent; using 1,024 overstates by 7.4. On a dashboard that is a slightly wrong line. On a threshold it is an alert that fires at a percentage you did not choose, and on a capacity plan it is the difference between provisioning enough and being 7 percent short at the moment the forecast said you would be comfortable.

Setting a percentage threshold against a GB allocation

Thresholds are usually meant as fractions of something: alert at 80 percent of the disk, page at 90 percent of the memory limit. That intent survives only if the fraction is taken of the allocation in the allocation's own unit and then converted once, at the end. Eighty percent of a gigabyte is 762.9 MiB and ninety percent is 858.3 MiB, and neither is a number anybody types by choice.

What people type instead is 800 and 900, which are round and are not the fractions they were meant to be — 800 MiB is 84 percent of a gigabyte and 900 MiB is 94. The alert still works, it fires later than the runbook says it does, and the discrepancy is invisible because both the rule and the documentation contain plausible round numbers.

What Prometheus stores and what the panel decides

Prometheus takes no position on any of this: the convention among its exporters is to record raw bytes with a _bytes suffix and let the presentation layer choose a unit. That is the right design and it moves the decision to the dashboard, where it is made per field, often by whoever built the panel, and rarely written down anywhere the person reading the graph will see.

The practical effect is that two panels on the same dashboard can show the same series 7 percent apart and both be correctly configured. A query returns bytes; one panel formats them in the SI sense and one in the IEC sense; the axes say GB and GiB, or worse, both say GB. When a number on a dashboard has to be compared with a number from anywhere else, check the field's unit setting first rather than the axis label.

Kubernetes limits, and the suffix that decides them

Container resources are the place this conversion is done most often and checked least. Kubernetes accepts both systems and distinguishes them properly: Mi and Gi are the binary quantities, M and G the decimal ones. A limit of 1G is 1,000,000,000 bytes; a limit of 1Gi is 1,073,741,824. Both are valid, both apply without warning, and they differ by 7.4 percent.

The trap is a chain where the units change at each link. Capacity is bought in decimal GB, a node is described in GiB, a limit is written in Mi, and a dashboard displays whichever it was configured for. Every conversion in that chain is doable; the failure is doing three of them by eye. Convert everything to bytes once, at the point where the numbers are compared, and let the friendly units be display only.

Reading a console figure without guessing its system

There is a workable heuristic and it should be treated as a heuristic. Numbers that describe something purchased — a plan, a quota, a bill, a transfer allowance — are almost always decimal, because that is the unit capacity is sold in. Numbers that come from inside a running machine — memory used, page cache, filesystem free space on Linux — are almost always binary, because that is what the kernel counts in.

Where the heuristic runs out, there is a test that does not. Find a quantity you can measure in bytes independently, put it through the console, and see which division reproduces the displayed figure. It takes one observation and it settles the question for that console permanently, which is a better use of five minutes than any amount of reading documentation that may not say.

What a 5 percent unit error looks like on a graph

It does not look like anything, and that is the difficulty. A line 5 percent above where it should be has the same shape, the same trend and the same rate of change as the correct one; nothing about it invites suspicion. The error only becomes visible where the graph is compared with an external figure — a bill, a quota, a second tool — and then it presents as a mystery rather than as a unit problem.

The one visual clue worth knowing is a headroom line that never quite lines up. If a usage series is plotted against a capacity line taken from somewhere else, and the usage plateaus at 93 or 107 percent of the capacity rather than at 100, that ratio is the unit gap rather than a measurement artefact. 1.074 and 0.931 are the two numbers to recognise; 1.049 and 0.954 are their one-step equivalents.

Making the unit explicit so the next person does not re-derive it

The lasting fix is not getting this conversion right once, it is making it unnecessary the next time. Name variables and metrics for what they hold — a threshold in bytes is a threshold in bytes, whatever it is displayed as — and put the derivation next to any literal that was converted by hand, so a reviewer can check 953.674 without going to look it up.

Where a system has to talk to another one, agree on bytes at the boundary and convert only at the edges. That is the same discipline used for time zones and currency and for the same reason: the ambiguity is not in the arithmetic, which is trivial, but in the number of places somebody has to remember which convention was in force. Reducing that to one place is the whole of the fix. It also gives the next person something to check against: a single documented boundary can be verified in a minute, while a convention applied from memory at six different points cannot be verified at all.

Convert GB to MiB: common questions

How many MiB are in a GB?

953.67431640625, exactly. A gigabyte is 1,000,000,000 bytes and a mebibyte is 1,048,576, and the division terminates. The number people reach for instinctively is 1,024, which is the MiB in a GiB, and using it here overstates the threshold by 7.4 percent.

Is 1 GB 1,024 MB or 1,000 MB?

A gigabyte is 1,000 megabytes and a gibibyte is 1,024 mebibytes. The habit of saying 1,024 comes from the binary units wearing decimal names for decades. If a tool means 1,024 and writes GB, it means a gibibyte, and its numbers will be 7.4 percent smaller than a decimal reading of the same bytes.

Which does Grafana use?

Whichever the panel is set to, and it offers both — a byte unit in the SI sense and one in the IEC sense, selected per field. Prometheus itself stores bytes and takes no position, so the convention is decided by the panel, and two panels on one dashboard can legitimately display the same series 7 percent apart.

Why is my alert firing at a different level than I expected?

The commonest cause is a threshold entered in one system and evaluated in the other. Eighty percent of a gigabyte is 762.9 MiB, not 800, so a rule written as 800 MiB against a 1 GB allocation fires at 84 percent rather than 80. Nothing is broken; the rule is doing exactly what it says.

Do cloud consoles say which unit they mean?

Some do and many do not. Where a figure is a purchased quantity — a plan, a quota, a billed amount — decimal is the safer assumption, because that is how capacity is sold. Where it comes from inside a machine, binary is more likely. When it matters, convert both readings and see which matches a byte count you can verify.

Does the difference matter on a small threshold?

It matters most where the threshold is meant to line up with something else. An alert at 90 percent of an allocation has to be computed against the same unit the allocation was made in, or the two are 5 to 7 percent apart and the alert loses the meaning it was given. On a threshold chosen by feel, the gap is inside the noise.

Going the other way: Mebibyte to Gigabyte

One MiB is 0.00104858 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.

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.