Double SHA256 Hash Generator

Compute SHA256(SHA256(input)) — the double-hash used in Bitcoin transaction IDs, block headers, and Proof-of-Work. Supports all input encodings including Hex and Base64.

Input
Output
Share Link
Settings

Related Hash Tools

Frequently Asked Questions

What is Double SHA256?
Double SHA256 (SHA256d) applies SHA-256 twice: SHA256(SHA256(input)). The first application hashes the input normally. The second application hashes the 32-byte result. The final output is a 256-bit (64 hex character) digest.
Why does Bitcoin use Double SHA256?
Bitcoin uses Double SHA256 to defend against length-extension attacks — a weakness of Merkle-Damgård hash functions where an attacker can compute H(m || extra) from H(m) without knowing m. Hashing the output a second time prevents this. Satoshi chose this construction over HMAC for simplicity.
How is a Bitcoin transaction ID computed?
A Bitcoin TXID is the Double SHA256 of the raw serialized transaction bytes, displayed with bytes reversed (little-endian). To verify a TXID, enter the transaction hex, select Hex input encoding, compute Double SHA256, and reverse the byte order of the result.
Double SHA256 vs SHA256 — when does it matter?
For general data integrity and digital signatures, single SHA-256 is sufficient and standard. Double SHA256 is specifically a Bitcoin protocol requirement. Using it outside of Bitcoin contexts adds computational cost with no security benefit, since length-extension attacks are not relevant to most use cases.

About Double SHA256 Hash Generator

Double SHA256 (commonly written SHA256d or SHA-256d) is a hash construction that applies the SHA-256 algorithm twice in sequence: hash = SHA256(SHA256(input)). The output is a 256-bit (64 hex character) digest, identical in length to a single SHA-256 hash. This construction was introduced by Bitcoin in 2009 and is used throughout the Bitcoin protocol for transaction IDs, block hashes, addresses, and Proof-of-Work.

Bitcoin's Use of Double SHA256

Bitcoin applies Double SHA256 to three primary operations. Transaction IDs (TXIDs) are the Double SHA256 of the raw serialized transaction bytes, displayed in reversed byte order. Block hashes are the Double SHA256 of the 80-byte block header. The Merkle root of a block is built by repeatedly Double-SHA256-hashing pairs of transaction IDs up the tree. Proof-of-Work mining consists of finding a block header nonce such that the Double SHA256 output begins with a required number of zero bits.

Why Hashing Twice?

Satoshi Nakamoto chose Double SHA256 as protection against length-extension attacks. In a standard Merkle-Damgård hash like SHA-256, an attacker who knows H(m) can compute H(m || padding || extra) without knowing m. This is exploited in certain MAC forgery attacks. Applying SHA-256 a second time destroys the internal state information needed for an extension, neutralizing the attack. An alternative defense is HMAC, but Double SHA256 is simpler for permissionless use without a secret key.

Computing Bitcoin TXIDs

To compute a raw Bitcoin TXID: serialize the transaction in the standard Bitcoin binary format, apply Double SHA256 to the bytes, then reverse the byte order of the 32-byte result. The reversed hex string is the displayed TXID. Note that block explorers display TXIDs in reversed order — this is a historical quirk of the original Bitcoin client. If you paste a raw transaction hex into this tool with Hex input encoding, you get the inner digest; reverse the bytes to match explorer output.

Double SHA256 vs Single SHA256

For all non-Bitcoin use cases — TLS certificates, code signing, package checksums, JWT tokens — single SHA-256 is the correct and standard choice. Double SHA256 is not a stronger general-purpose hash; it doubles computation time while providing no meaningful security improvement for use cases where length-extension attacks are not a concern. Use Double SHA256 specifically when working with Bitcoin protocol data.