Kubernetes

Resource Quantity Converter

Convert Kubernetes CPU and memory quantities, and see exactly how far Mi differs from M.

Memory quantity
Binary (IEC) suffix536,870,912 bytes≈ 512Mi

Binary (Ki, Mi, Gi …)

bytes
536,870,912
Ki
524,288
Mi
512
Gi
0.5
Ti
4.88e-4
Pi
4.77e-7
Ei
4.66e-10

Decimal (k, M, G …)

bytes
536,870,912
k
536870.912
M
536.871
G
0.537
T
0.001
P
5.37e-7
E
5.37e-10
CPU quantity
0.25 cores250m

Kubernetes measures CPU in cores, so 1 is one core and 100m is a tenth of one. Note that m means milli while M means mega — the two differ by nine orders of magnitude.

Total for the workload
Total memory
1.5Gi
Total CPU
0.75 cores
Why Mi is not M
Byte counts for decimal and binary suffixes at each scale
DecimalBytesBinaryBytesDifference
1k1,0001Ki1,024+2.40%
1M1,000,0001Mi1,048,576+4.86%
1G1,000,000,0001Gi1,073,741,824+7.37%
1T1,000,000,000,0001Ti1,099,511,627,776+9.95%
1P1,000,000,000,000,0001Pi1,125,899,906,842,624+12.59%
1E1,000,000,000,000,000,0001Ei1,152,921,504,606,847,000+15.29%

Writing 512M where 512Mi was meant gives the container about 25 MB less than intended — often enough to turn a working pod into an OOMKill loop.