What is a Nonce?

A nonce ("number used once") is a 32-bit number that miners change repeatedly when trying to mine a new Bitcoin block. The miner combines the block's data with a nonce, runs it through the SHA-256 hash function, and checks whether the resulting hash meets the network's difficulty target. If it doesn't, the miner increments the nonce and tries again — billions of times per second.

Why It Matters

The nonce is what makes Bitcoin mining a competitive, energy-intensive process. Because there's no shortcut to finding a valid nonce — you just have to guess and check — it ensures that mining requires real computational work. This is the foundation of proof of work. The miner who finds a valid nonce first gets to add the next block and claim the block reward. It's a fair, open lottery secured by physics and mathematics rather than trust.

How It Works

Each block header contains several fields: the previous block hash, a Merkle root of transactions, a timestamp, the difficulty target, and the nonce. Miners hash this header data repeatedly, changing the nonce each time. The nonce field is only 32 bits (about 4 billion possibilities), which modern mining hardware can exhaust in under a second. To keep searching, miners also modify other fields like the coinbase transaction or the timestamp, effectively creating a new set of 4 billion nonces to try. When a hash finally falls below the target, the block is valid and is broadcast to the network.