Tool
Mine a block, by hand.
Proof-of-work sounds like magic. It isn't. It's a guessing game against a target, and you can play it right here. This is the real algorithm: double-SHA-256 over a block header, hunting for a nonce whose hash starts with enough zeros.
The block header
Target: hash must be ≤
Double-SHA-256 of this header
…
What's actually happening (and why it secures Bitcoin)
A miner takes the block header, the previous block's hash, the transactions, and a number called the nonce, and hashes the whole thing with SHA-256, twice. The output is effectively random: change the nonce by one and the hash is completely different, with no way to predict it. So the only way to find a hash below the target is to try nonces, one after another, billions of times a second.
The target is what "difficulty" means. Requiring more leading zeros makes winning hashes exponentially rarer, each extra zero (in hex) makes the puzzle 16× harder. That's the cost that secures the chain: rewriting history would mean re-mining every block faster than the rest of the network mines new ones. Here you're doing it by hand, at a few thousand hashes a second. The real network does roughly 700 quintillion. Turn the difficulty up and feel why.