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 competitive and energy-intensive. There's no shortcut. You guess and check, billions of times per second. That's it. Mining requires real computational work, which is the foundation of proof of work and the reason an attacker cannot simply produce blocks on demand without paying for the energy. The miner who finds a valid nonce first adds the next block and claims the reward. 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. The Merkle root of transactions. A timestamp. The difficulty target. The nonce. Miners hash this header data repeatedly, changing the nonce each time.

The nonce field is only 32 bits. About 4 billion possibilities. Modern mining hardware can exhaust those in under a second. So miners also modify other fields, like the coinbase transaction or the timestamp, effectively creating a new set of 4 billion nonces to try each round. When a hash finally falls below the target, the block is valid and gets broadcast to the network.

A worked example. Bitcoin's network performs roughly 600 quintillion hashes per second as of 2026. Each hash is a candidate nonce being tested against the current target. The vast majority produce invalid results and get discarded instantly. Only the rare nonce that produces a hash below the target wins. Block 840,000 (the 2024 halving block) was solved with a specific nonce after roughly 50 trillion total guesses across the network. The miner who happened to find it claimed 3.125 BTC plus over 37 BTC in transaction fees. Nobody can predict which nonce will work. That unpredictability is the entire point of proof of work and the reason an attacker can't shortcut the process by being clever.