Skip to main content

Memory Size Calculations

This is one thing that's often misunderstood and confused by me. There are two different things referred to when memory sizes are mentioned in discussions.

  1. Simply number of bits or bytes - Then we need to know how much memory is needed to store the bits.
  2. Size of the payload - Then we already know the size. No further calculation needed.

We can just convert between bits and bytes by dividing or multiplying by 2ยณ.

different ways of representing
  • When number of bits are given - if it's power of 2, then we can directly refer to the table.
  • When the number of bits isn't power of 2, then we can directly calculate the size required.
Number of bitsRequired Memory to Store
2ยนโฐ1 KB
2ยฒโฐ1 MB
2ยณโฐ1 GB
2โดโฐ1 TB
2โตโฐ1 PB
2โถโฐ1 EB
Important to remember

It's important to remember this table for interviews in system design to quickly analyse space requirements.