user96148: When bitcoin miners mine, they have to solve a difficult and extremely repetitive math problem using the SHA256 algorithm. The miners are trying (basically playing lottery and almost always working in large groups) to get a hash with (currently) at least ~18.81 zeroes. (I put a decimal/float number because the value is inconsistent.) But, I want to put the hash into a hash function and get that super hard-to-compute number for a story I have where a superhero calculates this number. How do I get this string (nonce) that calculates to this zeroed hash and where do I find this on a block explorer, such as blockchain.com, or on bitcoin-cli?

user136068: To calculate the PoW hash, all the data of the header of the block is concatenated. The nonce is also concatenated within that data.
Then, that concatenated data is put through the SHA256 algorithm and the result is compared to the current target. The resulting hash needs to be smaller than the target to be valid.
So, it's not about how many zeros it has, but if it's smaller than the target.
Seeing it in terms of zeros could help to understand it, but that is miss leading. There could be 1 hash that has exactly the same number of zeros as the target and still not be valid, because it may not be smaller than the target.
For example, let's assume that the target is:
00000000000000000004f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
And our SHA256 hash is:
00000000000000000005f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
It would not be a valid PoW hash because it's not smaller than the target. They both have the same amount of zeros, but our hash is greater than the target.
Both together:
00000000000000000004f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6 00000000000000000005f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
If we keep changing a bit the data, by increasing the nonce by 1 and then concatenating it again with the data of the block header, and pass it through the SHA256 alright again and again, eventually we will get a hash that is smaller than the target.
For example:
Target:
00000000000000000004f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
Our hash:
00000000000000000003f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
As you can see, our hash now is smaller than the target and is a valid PoW hash for our block.
The hash of the block header data could even be way smaller than the target, and it's valid. It can have more zeros, but finding a hash like this is less probable in average:
00000000000000000000000000a8c59d52c4472ec3798c16f394a699f5e6d8b6
To visualize it better, you can go to this site that has a simple blockchain implementation to visualize how a blockchain works: https://andersbrownworth.com/blockchain/blockchain
I've concatenated the data of the block 5 and passed it through a SHA256 function:
Concatenated data:
529742data0000ae8bbc96cf89c68be6e10a865cc47c6c48a9ebec3c6cad729646cefaef83
SHA256 hash of that data:
0000d73c6ecf38aa53a8fbace738ff59540fd5e519e6d9aa496f61ce70110a09
If we compare the hash of block 5 with this one, it's the same.

96148: <p>When bitcoin miners mine, they have to solve a difficult and extremely repetitive math problem using the SHA256 algorithm. The miners are trying (basically playing lottery and almost always working in large groups) to get a hash with (currently) at least ~18.81 zeroes. (I put a decimal/float number because the value is inconsistent.) But, I want to put the hash into a hash function and get that super hard-to-compute number for a story I have where a superhero calculates this number. How do I get this string (nonce) that calculates to this zeroed hash and where do I find this on a block explorer, such as blockchain.com, or on bitcoin-cli?</p>
 136068: <p>To calculate the PoW hash, all the data of the header of the block is concatenated. The nonce is also concatenated within that data.
Then, that concatenated data is put through the <code>SHA256</code> algorithm and the result is compared to the current target. The resulting hash needs to be smaller than the target to be valid.</p>
<p>So, it's not about how many zeros it has, but if it's smaller than the target.
Seeing it in terms of zeros could help to understand it, but that is miss leading. There could be 1 hash that has exactly the same number of zeros as the target and still not be valid, because it may not be smaller than the target.</p>
<p>For example, let's assume that the target is:</p>
<p><code>00000000000000000004f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6</code>
And our <code>SHA256</code> hash is:</p>
<p><code>00000000000000000005f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6</code>
It would not be a valid PoW hash because it's not smaller than the target. They both have the same amount of zeros, but our hash is greater than the target.</p>
<p>Both together:
<code>00000000000000000004f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6 00000000000000000005f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6</code>
If we keep changing a bit the data, by increasing the nonce by 1 and then concatenating it again with the data of the block header, and pass it through the <code>SHA256</code> alright again and again, eventually we will get a hash that is smaller than the target.</p>
<p>For example:</p>
<p>Target:</p>
<p><code>00000000000000000004f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6</code></p>
<p>Our hash:</p>
<p><code>00000000000000000003f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6</code>
As you can see, our hash now is smaller than the target and is a valid PoW hash for our block.</p>
<p>The hash of the block header data could even be way smaller than the target, and it's valid. It can have more zeros, but finding a hash like this is less probable in average:</p>
<p><code>00000000000000000000000000a8c59d52c4472ec3798c16f394a699f5e6d8b6</code></p>
<p>To visualize it better, you can go to this site that has a simple blockchain implementation to visualize how a blockchain works: <a href="https://andersbrownworth.com/blockchain/blockchain" rel="nofollow noreferrer">https://andersbrownworth.com/blockchain/blockchain</a></p>
<p>I've concatenated the data of the block <code>5</code> and passed it through a <code>SHA256</code> function:</p>
<p>Concatenated data:</p>
<p><code>529742data0000ae8bbc96cf89c68be6e10a865cc47c6c48a9ebec3c6cad729646cefaef83</code></p>
<p><a href="https://andersbrownworth.com/blockchain/hash" rel="nofollow noreferrer">SHA256</a> hash of that data:</p>
<p><code>0000d73c6ecf38aa53a8fbace738ff59540fd5e519e6d9aa496f61ce70110a09</code>
If we compare the <code>hash</code> of block <code>5</code> with this one, it's the same.</p>
