How Is a Change in Bitcoin’s Difficulty Calculated and Implemented?

Bitcoin's difficulty adjusts every 2,016 blocks, which is approximately every two weeks, assuming a 10-minute block time. The adjustment algorithm compares the actual time taken to mine the previous 2,016 blocks against the target time (20,160 minutes).

If the blocks were mined faster, difficulty increases; if slower, it decreases. This ensures a consistent issuance schedule regardless of the total hash power on the network.

How Is Mining Difficulty Calculated and Adjusted?
How Does the Difficulty Target Adjust over Time in Bitcoin?
How Does Mining Difficulty Adjust on a Blockchain?
How Is the ‘Difficulty’ Adjusted in the Bitcoin Mining Process?
What Is the Role of the ‘Target’ in the Bitcoin Difficulty Adjustment?
How Can a Large, Sudden Drop in Hash Rate Lead to a Temporary Mining ‘Windfall’?
What Is the “Retarget Period” in the Bitcoin Difficulty Adjustment Mechanism?
How Does the Difficulty Adjustment Mechanism Relate to SHA-256’s Output?

Glossar