Computing & Software
Cache Address Tag, Index & Offset Calculator
Split a physical address into cache tag, set-index and byte-offset widths for a power-of-two cache.
How the calculation works
Cache data lines = cache_bytes/line_bytes lines. Cache sets = cache_bytes/(line_bytes*ways) sets. Byte offset width = log(line_bytes)/log(2) bits. Set index width = log(cache_bytes/(line_bytes*ways))/log(2) bits. Tag width = address_bits-log(line_bytes)/log(2)-log(cache_bytes/(line_bytes*ways))/log(2) bits.
Worked example
Example inputs — Total data capacity (bytes): 65536; Cache line size (bytes): 64; Associativity: ways per set: 8; Physical address width (bits): 32. Expected results — Cache data lines: 1024 lines; Cache sets: 128 sets; Byte offset width: 6 bits; Set index width: 7 bits; Tag width: 19 bits.
Assumptions and limits
Analytical software/hardware scenario, not a benchmark or a live provider quote. Use the actual architecture, workload and billing definitions; overheads not named in the model are excluded. Data capacity excludes metadata. Assumes conventional power-of-two indexing without hashing, virtual-index aliasing or skewed associativity.
Reference and further reading
Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.
Related calculators
- Password Entropy & Brute-Force Time Estimate
- CPU Instruction Count & CPI Runtime Calculator
- Amdahl & Gustafson Parallel Speedup Calculator
- Roofline Arithmetic Intensity Performance Calculator
- Memory Bus Theoretical Bandwidth Calculator
Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.