Cheat Sheet

Data Size Units and Memory Units Cheat Sheet

  • Bit (b): The smallest unit of digital information (0 or 1).
  • Nibble: 4 bits.
  • Byte (B): Commonly 8 bits.
UnitAbbreviationFactorExact Bytes
KilobyteKB10³1,000 bytes
MegabyteMB10⁶1,000,000 bytes
GigabyteGB10⁹1,000,000,000 bytes
TerabyteTB10¹²1,000,000,000,000 bytes
PetabytePB10¹⁵1,000,000,000,000,000 bytes
ExabyteEB10¹⁸1,000,000,000,000,000,000 bytes
UnitAbbreviationFactorExact Bytes
KibibyteKiB2¹⁰1,024 bytes
MebibyteMiB2²⁰1,048,576 bytes
GibibyteGiB2³⁰1,073,741,824 bytes
TebibyteTiB2⁴⁰1,099,511,627,776 bytes
PebibytePiB2⁵⁰1,125,899,906,842,624 bytes
ExbibyteEiB2⁶⁰1,152,921,504,606,846,976 bytes
TermTypical SizeWhat Is It?Where Is It?Who Uses It?Why This Size?
Cache Line~64 bytes (on modern CPUs)Smallest chunk of data fetched/stored by CPU cacheCPU caches (L1, L2, L3)CPU hardware, cache controllerBalances transfer overhead vs. spatial locality; 64 bytes is common for modern architectures
Memory Page4 KB (commonly), 2 MB, 1 GBFundamental unit of virtual memory managementSystem RAM, managed by the OSOS, CPU MMU (Memory Management Unit), TLBStandard 4 KB minimizes overhead of page tables; larger pages (2 MB, 1 GB) reduce TLB pressure for big data workloads
Disk BlockTypically 512 bytes or 4 KBSmallest addressable unit on storage devices (HDD, SSD)Physical storage (disk/SSD)Disk controllers, file systemsHistorically 512 bytes was standard; many drives now use 4 KB for efficiency and error correction
File-System BlockOften 4 KB, can be biggerUnit in which file systems allocate and manage disk spaceFile system layer on top of disk blocksOS file system driver, user-level I/OMatches or aligns with disk block size and common page size for simpler I/O and reduced fragmentation