IEC vs. SI Standards, Bitmasks & Powers of Two
Why a 1 TB NVMe drive reports as ~931 GiB in your OS, plus quick-lookup tables for binary prefixes, hex masks, and 2n boundaries.
IEC Binary Prefixes (Base-2) vs. SI Decimal Prefixes (Base-10)
Defined by IEC 80000-13. Hardware manufacturers & ISPs use SI (103n); kernels, RAM modules, and filesystems typically use IEC (210n).
| IEC Binary | Binary Factor | Exact Bytes (IEC) | SI Decimal | Decimal Factor | Exact Bytes (SI) | IEC vs SI Gap |
|---|---|---|---|---|---|---|
| KiB Kibibyte | 210 | 1,024 | KB Kilobyte | 103 | 1,000 | +2.40% |
| MiB Mebibyte | 220 | 1,048,576 | MB Megabyte | 106 | 1,000,000 | +4.86% |
| GiB Gibibyte | 230 | 1,073,741,824 | GB Gigabyte | 109 | 1,000,000,000 | +7.37% |
| TiB Tebibyte | 240 | 1,099,511,627,776 | TB Terabyte | 1012 | 1,000,000,000,000 | +9.95% |
| PiB Pebibyte | 250 | 1,125,899,906,842,624 | PB Petabyte | 1015 | 1,000,000,000,000,000 | +12.59% |
| EiB Exbibyte | 260 | 1,152,921,504,606,846,976 | EB Exabyte | 1018 | 1,000,000,000,000,000,000 | +15.29% |
Common Bitmasks, Hex Constants & IPv4 Subnets
Frequently used byte masks for low-level parsing, bitwise flag operations, and CIDR subnetting.
| Mask / CIDR | Hexadecimal | Binary Pattern | Decimal / Hosts | Common Usage |
|---|---|---|---|---|
| Low Nibble (4-bit) | 0x0F | 0000 1111 | 15 | Extract lower 4 bits of a byte |
| High Nibble (4-bit) | 0xF0 | 1111 0000 | 240 | Extract upper 4 bits (shift >> 4) |
| 7-bit ASCII Mask | 0x7F | 0111 1111 | 127 | Clear MSB / validate 7-bit ASCII |
| Full Octet (uint8) | 0xFF | 1111 1111 | 255 | Isolate single byte in word |
| 16-bit Word (uint16) | 0xFFFF | 16 × 1 | 65,535 | TCP/UDP port range, UTF-16 BMP |
| IPv4 /32 | 0xFFFFFFFF | 255.255.255.255 | 1 host | Single host route / loopback |
| IPv4 /30 | 0xFFFFFFFC | 255.255.255.252 | 4 IPs (2 usable) | Point-to-point router / tunnel link |
| IPv4 /24 | 0xFFFFFF00 | 255.255.255.0 | 256 IPs (254 usable) | Standard LAN / Class C subnet |
| IPv4 /16 | 0xFFFF0000 | 255.255.0.0 | 65,536 IPs | RFC 1918 192.168.0.0/16 block |
| IPv4 /8 | 0xFF000000 | 255.0.0.0 | 16,777,216 IPs | RFC 1918 10.0.0.0/8 private space |
Powers of Two (20 – 264)
Key binary boundaries across integer widths, virtual memory paging, networking, and storage addressing.
| Power | Exact Decimal Value | IEC Equivalent | Computing Context |
|---|