About the Cache Cruncher calculator
Cache Cruncher is a free online cache and memory bits calculator
designed for students taking computer architecture or computer organization
courses. Type any combination of values you already know — cache size,
block size, associativity, address width, page size, TLB rows — and every
derived field fills in automatically. Because the solver is bidirectional,
you can drive it from either side of an equation: edit
num_blocks and cache_size recomputes; edit
cache_size and num_blocks recomputes.
What can you calculate?
- Cache configuration: number of blocks, number of sets, index bits, offset bits, tag bits, tag-array storage, valid-bit overhead, and total cache overhead.
- Memory addressing: physical and virtual address space, addressable memory, and the relationship between bits and bytes.
- Virtual memory: page size, page offset bits, virtual page number bits, virtual and physical page counts, and full page-table size estimation including protection bits.
- TLB: TLB index bits and TLB tag bits from VPN width and the number of TLB rows.
Example: a 32 KB, 4-way set-associative cache with 64-byte blocks
Enter cache_size = 32 KB, block_size = 64,
associativity = 4, and address_size = 32.
Cache Cruncher derives 512 blocks, 128 sets, 7 index bits,
6 offset bits, and 19 tag bits — instantly, with no submit button.
Frequently asked questions
How do I calculate index bits in a cache?
Index bits = log₂(number of sets). Number of sets equals the cache size divided by (block size × associativity). For a direct-mapped cache, associativity is 1.
How do I calculate tag bits?
Tag bits = address size − (index bits + offset bits). Offset bits = log₂(block size in bytes).
How do I calculate TLB tag bits?
TLB tag bits = virtual page number bits − log₂(TLB rows), where VPN bits = virtual address size − page offset bits.
Is my data sent anywhere?
No. Cache Cruncher runs entirely in your browser. There is no backend, no analytics, and no tracking. The Cloudflare Worker only serves the static HTML, CSS, and JavaScript.