Page Size Calculator
Calculate page offset, page number and frame bits, the number of pages and frames, page table size, levels of a multi-level page table and TLB reach for a virtual memory system.
Single-level Page Table Size
4 MB
Address Split
20 page bits + 12 offset bits
Virtual Pages
10,48,576
Physical Frames
10,48,576 (20 frame bits)
Multi-level Table
2 levels: 10 + 10 + 12 offset
Entries per Table Page
1024
TLB Reach
256 KB
Virtual / Physical Space
4 GB / 4 GB
Paging, Page Tables and TLB Reach
Enter the virtual and physical address widths, page size, page table entry size and TLB size. The calculator splits the address into page number and offset, sizes the page table, and shows how many levels a hierarchical table needs.
Formulas
- Offset bits = log₂(page size)
- Pages = 2virtual bits − offset; frames = 2physical bits − offset
- Table size = pages × PTE size
- Levels = ceil(page bits ÷ log₂(page size ÷ PTE size))
- TLB reach = TLB entries × page size
Common architectures
| System | Virtual bits | Page | PTE | Levels |
|---|---|---|---|---|
| 32-bit x86 | 32 | 4 KB | 4 B | 2 (10 + 10) |
| x86 PAE | 32 | 4 KB | 8 B | 3 (2 + 9 + 9) |
| x86-64 | 48 | 4 KB | 8 B | 4 (9 × 4) |
| x86-64 LA57 | 57 | 4 KB | 8 B | 5 (9 × 5) |
| ARM64 (64 KB pages) | 48 | 64 KB | 8 B | 3 |
Worked examples
1. 32-bit, 4 KB pages, 4-byte entries (the defaults). 12-bit offset; 2²⁰ pages; 4 MB table; 2 levels of 10 bits; TLB reach 256 KB.
2. x86-64: 48-bit virtual, 52-bit physical, 8-byte PTEs, 1,536-entry TLB. Flat table would be 512 GB; 4 levels of 9 bits; reach 6 MB.
3. Textbook: 16-bit virtual, 15-bit physical, 1 KB pages, 2-byte entries. 10-bit offset; 64 pages, 32 frames; 128-byte table.
Real systems may reserve PTE bits for flags and use different sizes at each level.
Related tools
- Memory speed: Cache Hit Calculator. Powers of two: Binary Calculator.
Frequently Asked Questions
How many bits is the page offset?
log₂(page size in bytes). A 4 KB page (4,096 bytes) needs a 12-bit offset.
How many pages are in the virtual address space?
2^(virtual address bits − offset bits). A 32-bit address with 4 KB pages has 2²⁰ = 1,048,576 pages.
How do I calculate page table size?
Number of pages × page table entry size. 2²⁰ entries × 4 bytes = 4 MB for each process with a single-level table.
How many frames does physical memory have?
2^(physical address bits − offset bits). With 32-bit physical addresses and 4 KB pages: 2²⁰ frames.
Why use multi-level page tables?
A flat table for a 48-bit space with 8-byte entries would need 512 GB per process. Splitting the page number lets unused regions have no tables at all.
How many levels are needed?
Each level fits in one page: entries per page = page size ÷ PTE size; bits per level = log₂ of that; levels = ceil(page-number bits ÷ bits per level). x86-64: 4 KB ÷ 8 = 512 entries = 9 bits; 36 ÷ 9 = 4 levels.
What is TLB reach?
TLB entries × page size: the memory the TLB can map without a page-table walk. 64 entries × 4 KB = 256 KB; huge pages (2 MB) raise it greatly.
What are huge pages?
Larger pages (2 MB or 1 GB on x86-64) that reduce page-table size and TLB misses for big memory users such as databases and virtual machines.
What is in a page table entry?
The frame number plus control bits: valid/present, read/write, user/supervisor, accessed, dirty and no-execute.
Does this use 1,024 for KB?
Yes. Memory sizes here are binary: 1 KB = 1,024 bytes, as in operating systems textbooks.
Related Calculators
Cache Hit Calculator
Calculate cache hit ratio, miss ratio, average memory access time (AMAT), and speedup from cache hits, misses, and access times.
Storage Calculator
Convert between storage units (Bytes, KB, MB, GB, TB, PB) and calculate RAID usable capacity for different configurations.
Binary Calculator
Convert between decimal, binary, octal, and hexadecimal number systems. Perform bitwise AND, OR, XOR, NOT, and shift operations.
Big O Complexity Calculator
Estimate algorithm performance based on input size and time complexity class. Compare O(1), O(log n), O(n), O(n log n), O(n^2), and O(2^n).
IP Subnet Calculator
Calculate subnet mask, network address, broadcast address, and number of usable hosts from an IP address and CIDR prefix length.
Floating Point Calculator
Convert a decimal number to its IEEE 754 floating point representation. View sign, exponent, and mantissa bits for single and double precision.
More in Computer Science · Engineering calculators · All calculators A–Z