Memory latency numbers every programmer should know: L1 to HDD in nanoseconds
Every programmer should know these numbers. They're the difference between code that works and code that's fast. Keep your data as close to the CPU as possible, avoid random memory access on large datasets, and never read from disk in a hot path.
Computer memory spans 7 orders of magnitude in latency: from L1 cache at roughly 1 nanosecond to spinning HDD at roughly 10 milliseconds. Each step up the hierarchy is roughly 10-100x slower than the step below it. These numbers aren't academic. They explain why your program is slow and what to do about it.
By TechCompare · Updated
How this is calculated
The rough latency numbers for a modern desktop CPU (2026): L1 cache ~1 ns (3-5 cycles at 4 GHz). L2 cache ~3-4 ns (12-16 cycles). L3 cache ~10-15 ns (40-60 cycles). DDR5 RAM ~50-80 ns (200-320 cycles). NVMe SSD ~50-100 µs (50,000-100,000 ns). SATA SSD ~100-200 µs. HDD ~5-15 ms (5,000,000-15,000,000 ns). To put this in human terms: if L1 cache access were 1 second, RAM access would be almost 1.5 minutes. An HDD access would be over 4 months. This is why caching works, why SSDs transformed computing, and why in-memory databases are fast.
Verdict
The ladder spans seven orders of magnitude and that scale is the whole lesson. L1 at roughly 1 ns climbs through L2 (3-4 ns), L3 (10-15 ns), DDR5 (50-80 ns), NVMe (50-100 microseconds), SATA SSD (100-200 microseconds), to HDD (5-15 ms). Compressed to human time, if L1 were one second, RAM would be one and a half minutes and an HDD read would take four months. That ratio is why caching works and why in-memory databases feel instant.
More Latency scenarios
Related guides
Frequently asked questions
What are the memory latency numbers every programmer should know?
What does the 'if L1 cache were 1 second' analogy look like?
Why are in-memory databases so much faster?
Related tools
RAM Latency Calculator
Convert DDR3/DDR4/DDR5 timings (CL, tRCD, tRP, tRAS) into true latency in nanoseconds.
Use tool ➜RAID Calculator
Calculate usable capacity and fault tolerance for RAID 0, 1, 5, 6, and 10.
Use tool ➜Display Bandwidth Calculator
Check if your HDMI/DP cable supports your resolution and refresh rate.
Use tool ➜