Tools / K8s CPU / Memory Units Calculator

K8s CPU / Memory Units Calculator.

Convert Kubernetes CPU and memory quantities (500m, 512Mi, 1G) and total them across replicas.

Runs in your browser

One quantity per line. An optional label before a colon (cpu, memory) decides the resource.

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Totals
Quantities

About K8s CPU / Memory Units Calculator

Kubernetes resource quantities pack a lot of meaning into a few characters, and a single wrong letter changes the value by orders of magnitude. This calculator reads one quantity per line, exactly as you would write it in a pod spec, and shows what Kubernetes will understand. CPU values become cores and millicores, so 250m is a quarter of a core and "1.5" is 1500m. Memory values become bytes, MiB and GiB: 512Mi is 536,870,912 bytes, while 1G is one billion bytes, or only 953.67 MiB. The difference between decimal suffixes (k, M, G) and binary ones (Ki, Mi, Gi) is the most common sizing mistake, and the tool flags every decimal memory value and suggests the binary form you probably meant. It also catches the nastier typo of writing 128m for memory: in Kubernetes "m" means milli, so that is a thousandth of a byte per unit, not 128 megabytes. CPU values finer than one millicore are flagged too, because the API server will not keep that precision. Labels such as requests.cpu or limits.memory before a colon decide whether a bare number is CPU or memory; without a label, binary and decimal byte suffixes count as memory and everything else as CPU. Set the replica count to see what a Deployment asks of the cluster in total, which helps when you check namespace quotas or node capacity. Suffixes are case-sensitive, as in Kubernetes itself, and all parsing happens in your browser.

How to Use

  1. Paste quantities from your manifest, one per line, optionally with labels such as requests.cpu or limits.memory.
  2. Set the number of replicas and, if the lines have no labels, force the resource type.
  3. Check the notes column for suffix mistakes and read the totals for the whole workload.

Frequently Asked Questions

What is the difference between M and Mi?

M is decimal (1,000,000 bytes) and Mi is binary (1,048,576 bytes). 1Gi is about 7% more than 1G. Kubernetes accepts both, which is why mixing them up goes unnoticed.

What does 500m mean?

For CPU it is 500 millicores, half of one core. For memory the same suffix would mean 0.5 bytes, which is almost always a typo for 500Mi.

Can I write CPU as a decimal like 0.5?

Yes. 0.5 and 500m are the same quantity. Precision below 1m (for example 0.0005) is not allowed and gets rounded up.

Is my manifest uploaded?

No. The quantities are parsed in your browser; nothing is sent to a server.

Related Tools