Kubernetes Resource Units Converter
Paste the value from a manifest exactly as written, suffix and all. The suffix is where the mistakes live.
Suffix reference
| Suffix | Means | Use for |
|---|---|---|
| m | one thousandth | CPU millicores. Never memory |
| (none) | one | whole CPU cores, or bytes |
| k, M, G, T | powers of 1,000 | rarely what you want for memory |
| Ki, Mi, Gi, Ti | powers of 1,024 | memory, almost always |
| e6, e9 | scientific notation | accepted, but hard to read |
What 500m, 128Mi and 1G really mean, and the suffix mistakes that validation lets through.
Mi against M: binary and decimal memory
Kubernetes accepts two families of memory suffix and they are not interchangeable. Ki, Mi and Gi are powers of 1,024; k, M and G are powers of 1,000. So 1Gi is 1,073,741,824 bytes and 1G is 1,000,000,000, about 7% less. Operating systems and the kubelet count memory in binary units, so a limit written in decimal leaves a container with less headroom than its author thought, and it is a common reason for OOM kills that look impossible on paper.
The lowercase m trap
In Kubernetes, m means milli on every resource. On CPU that is millicores, which is exactly what you want. On memory it is millibytes, so memory: 128m requests 0.128 bytes. The API server accepts it, the scheduler happily places the pod, and the problem surfaces later as an unschedulable limit or a container killed on start. If you find a lowercase m next to memory anywhere in a manifest, it is almost certainly a typo for Mi.
CPU millicores and what a core is
One CPU is 1,000 millicores: 500m and 0.5 are the same request. Kubernetes refuses precision finer than 1m and rounds up. Worth knowing too that one Kubernetes CPU is one vCPU, and on most cloud instances that is a single hyperthread rather than a physical core, so a two vCPU node is typically one core with hyperthreading. Once you have settled the numbers, the Kubernetes QoS calculator shows which eviction class your requests and limits put a pod in.
Suffixes the API server rejects
Quantities are case sensitive and use short suffixes only. MB, GB, GiB and a capital K are all invalid and fail at apply time. Scientific notation such as 129e6 is valid but hard to review, and kubectl may print a value back in a different spelling from the one you wrote, such as 1048576Ki for 1Gi. Same amount, less readable.
Kubernetes units FAQs
What is the difference between Mi and M in Kubernetes?
Mi is a mebibyte, 1,048,576 bytes. M is a megabyte, 1,000,000 bytes. So 128Mi is 134,217,728 bytes and 128M is 128,000,000, about 5% less, and the gap widens to around 7% at gigabyte scale. For memory you almost always want the binary forms, Mi and Gi, because that is how operating systems and the kubelet report usage.
What does memory: 128m mean?
Probably not what was intended. The m suffix means milli everywhere in Kubernetes, so 128m of memory is 0.128 bytes. The API server accepts it without complaint, which is why it is one of the most common typos in manifests. On CPU, m is exactly right: 128m is 128 millicores.
How many millicores are in a CPU?
One thousand. 1000m is one core, 500m is half a core, and 250m is a quarter. You can write whole cores as plain numbers too, so 0.5 and 500m mean the same thing. Kubernetes does not accept precision finer than 1m and rounds anything smaller up.
Is one Kubernetes CPU one physical core?
It is one vCPU, meaning one hyperthread on most cloud instances rather than a full physical core. On AWS, an m5.large reports two vCPUs, which is one physical core with hyperthreading. That is why CPU-bound work often gets less throughput per request than the number suggests.
Why does kubectl show memory in Ki?
Because the API stores quantities canonically and kubectl prints what it stores, often converting to the smallest binary suffix that represents the value exactly. A request written as 1Gi can come back as 1048576Ki. It is the same amount, just a less convenient spelling.
Can I use MB or GB in a manifest?
No. The valid suffixes are case sensitive and short: k, M, G, T, P and E for decimal, Ki, Mi, Gi, Ti, Pi and Ei for binary, plus m, u and n for fractions. MB, GB and a capital K are rejected by the API server.
Is anything I paste sent to a server?
No. Parsing runs entirely in your browser and the page works offline.