# Cache Hit Ratio Calculator

> Calculate a cache hit ratio and miss ratio from hits and misses, and the average response time when hits and misses have different latencies.

Category: Software, cloud & AI · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/cache-hit-ratio-calculator

Hit ratio = hits ÷ (hits + misses). With hit and miss latencies, the average response time is the hit ratio × hit time + miss ratio × miss time.

Also called: Cache hit rate calculator, CDN offload calculator.

## Inputs
- Cache hits (default 9500)
- Cache misses (default 500)
- Latency on a hit (unit ms; default 1; optional)
- Latency on a miss (unit ms; default 50; optional)

## Results
- Hit ratio
- Miss ratio
- Total requests
- Average latency

## Formula

```
Hit ratio = Hits ÷ (Hits + Misses);  Average latency = H × Hit latency + (1 − H) × Miss latency
```

Where:
- H: hit ratio as a decimal

## Worked example
1. Hit ratio: 9,500 ÷ 10,000 = 95%.
2. Average latency: 0.95 × 1 + 0.05 × 50 = 0.95 + 2.5 = 3.45 ms.

**Result:** 9,500 hits out of 10,000 requests is a 95% hit ratio, giving an average latency of 3.45 ms.

## What the result means

Look at the miss ratio rather than the hit ratio: going from 95% to 99% hits cuts misses, and load on the origin, by 80%. Misses usually dominate average latency.

## Assumptions and limits
- Every hit and every miss takes the average time entered.
- Byte hit ratio (share of bytes served from cache) can differ a lot from request hit ratio when large files are cached less often.

## Questions

### What is a good hit ratio?

It depends on the cache. Static-asset CDNs often aim very high; application caches with personalised data are lower. Track it over time rather than against a fixed target.

### Where do I find hits and misses?

Redis reports keyspace_hits and keyspace_misses in INFO stats; CDNs show cache status in their analytics or response headers.

## Related calculators
- [CDN Bandwidth Cost Calculator](https://calculators.geekmidst.com/calculators/cdn-bandwidth-cost-calculator)
- [P95 Latency Calculator](https://calculators.geekmidst.com/calculators/p95-latency-calculator)
- [Percentage Calculator](https://calculators.geekmidst.com/calculators/percentage-calculator)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/cache-hit-ratio-calculator
