Data & cryptography · 2 min read

What is a Merkle tree?

By Oliver James Whitmore · Updated 20 October 2026

In one sentence

A Merkle tree is a way of hashing many items in pairs, level by level, until a single hash — the Merkle root — stands for all of them at once.

A Merkle tree over four transactions. To prove that Tx C is included, only H(D) and H(AB) are needed.Tx AH(A)Tx BH(B)Tx CH(C)Tx DH(D)H(AB)H(CD)Merkle rootProof for Tx C: H(D) and H(AB), shown in amber — two hashes instead of all transactions
A Merkle tree over four transactions. To prove that Tx C is included, only H(D) and H(AB) are needed.

How it works

Start with a list of items, for example the transactions in a block. Hash each one; these hashes are the leaves. Then join the leaves in pairs and hash each pair, giving half as many hashes on the next level. Repeat until one hash remains. That final value is the Merkle root. In Bitcoin, if a level has an odd number of hashes, the last one is paired with itself.

The root is tiny — 32 bytes — whether the block holds ten transactions or several thousand, and it goes into the block header. Change any transaction, even by one bit, and its leaf changes, which changes its parent, and so on all the way up: the root no longer matches.

The clever part is proof of inclusion. To show that one transaction is in a block, you do not need the other transactions. You only need the hashes along its branch: its neighbour at each level. With those, anyone can recompute the root and compare it to the header. The number of hashes needed grows very slowly — about twelve for a block of four thousand transactions.

The structure is named after the cryptographer Ralph Merkle, who described it in work from 1979 onward.

A simple example

A phone app wants to confirm that a payment was included in block 800,000 without downloading the whole block. It already has the block header. It asks a full node for the transaction and a branch of about a dozen hashes, recomputes the root and compares. If the result matches the root in the header, the transaction is in the block; a forged branch cannot produce the right root.

Common misconception

Misconception: The Merkle root contains the transactions in compressed form.

In fact: The root is a fingerprint, not a container. It cannot be unpacked into transactions; it only allows anyone who has a transaction and its branch to check that it belongs.

Where you meet it

  • Every Bitcoin block header.
  • Light clients, described in section 8 of the Bitcoin whitepaper as simplified payment verification.
  • Ethereum, which uses a related structure (a Merkle Patricia trie) for its state.
  • Outside crypto: Certificate Transparency logs and version-control systems.

Sources

This card explains a technical concept for general education. It is not a recommendation to acquire, sell or hold any crypto-asset, and it is not financial advice.