The Problem
Bitcoin needs predictable block times. If blocks come too fast, the blockchain grows too quickly and becomes harder to store. If blocks come too slow, transactions take forever to confirm.
But hashrate constantly changes—miners join, miners leave, new hardware comes online. How does Bitcoin maintain ~10 minute blocks?
The Algorithm
The formula is simple: compare how long the last 2,016 blocks actually took versus how long they should have taken (2 weeks).
| If blocks took... | Then difficulty... | Example |
|---|---|---|
| 1 week (too fast) | Increases ~2× | More hashrate joined |
| 2 weeks (perfect) | Stays same | Hashrate stable |
| 4 weeks (too slow) | Decreases ~0.5× | Miners left |
Safety limit: Difficulty can only change by 4× maximum per adjustment. This prevents extreme swings from attacks or sudden hashrate changes.
Interactive Simulator
Adjust the network hashrate and watch how difficulty responds over time. Each block in the timeline represents ~10 minutes. Blue blocks mark difficulty adjustments.
Difficulty Adjustment Simulator
Change hashrate mid-simulation to see how Bitcoin adapts.
The 2,016 Block Epoch
Bitcoin measures time in "epochs" of 2,016 blocks. At the end of each epoch, difficulty adjusts. Why 2,016? Because 2,016 × 10 minutes = 20,160 minutes = exactly 2 weeks.
The current epoch progress is shown above. When it fills up, difficulty recalculates based on how long those 2,016 blocks actually took.
Why This Matters
Difficulty adjustment is one of Bitcoin's most elegant features:
| Benefit | How Difficulty Adjustment Provides It |
|---|---|
| Predictable Supply | ~10 min blocks = predictable inflation rate |
| Attack Resistance | Can't speed up mining by adding more hashrate long-term |
| Self-Healing | Network recovers automatically if miners leave |
| No Central Control | Algorithm is deterministic—no human intervention needed |
Frequently Asked Questions
What happens if hashrate suddenly drops?
Blocks slow down until the next adjustment (usually 2 weeks). Then difficulty drops to match the new reality. Bitcoin adapts automatically—no human intervention needed.
Can difficulty go down?
Yes. When miners shut down (like after China's 2021 ban), difficulty has dropped. It can also never go below a minimum floor defined in the code—Bitcoin won't let the network become trivially easy to mine.
Why 2016 blocks?
2016 × 10 minutes = 20,160 minutes = 2 weeks. Satoshi picked this number so the network could respond to hashrate changes reasonably quickly without being too volatile.