Productivity and Utilities

Merkle Tree Builder

Enter items one per line to build the tree, read the root and test a proof for any item.

Your numbers

Example items. One per line, up to 128. Each line is hashed as UTF-8 text.

Puts a byte in front of each hash input so a leaf can never be mistaken for an inner node.

Counting from 1 in the order of the list.

Type different text to see the proof fail for an item that was changed.

Result

Merkle root (SHA-256)

e005b5664946b94dcae30e856ab0058930eb5ec65ca113c90331454335612140

Items
5
Levels
4
Proof for item 3
3 hashes
Proof check
The proof rebuilds the root

Levels from the leaves up

LevelNodesHashes (first 8 hex digits)
Leaves5709b55bd 27ca64c0 1f3cb18e 41b637cf a8c0cce8
Level 13bbea820f 5709445d 1527f21c
Level 22ea59a369 a8ca9aea
Root1e005b566

Proof path for item 3

StepSibling sideSibling hash (first 16 digits)
1Right41b637cfd9eb3e2f
2Leftbbea820f07f7f89a
3Righta8ca9aeaccc1f6de
How this was calculated
  1. Each item is hashed with SHA-256 to make a leaf. Neighboring hashes are joined (left then right) and hashed again to make the next level, until one hash, the root, is left.
  2. A level with an odd number of nodes hashes the last node with a copy of itself. (This rule makes two different lists able to share a root, for example when the last item is repeated.)
  3. A proof is the sibling hash at each level. Hash the item, combine it with each sibling on the stated side, and the result must equal the root. Changing any item changes every hash above it.
  • This page builds a tree for learning and checking. Real systems fix their own rules for encoding, ordering and padding, so a root from here will only match a system that uses exactly these rules.

Calculated using SumPanda.com · https://sumpanda.com/merkle-tree-builder/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the merkle tree builder

  1. Enter the items, one per line. Each line is hashed as UTF-8 text with SHA-256.
  2. Choose how to treat an odd node at a level: hash it with itself, or carry it up unchanged. Tick the box for the 00 and 01 prefixes to follow the RFC 6962 style.
  3. Pick the number of the item to prove. To see a failed check, type different text in the box for an item to check instead.
  4. Read the root, the levels of hashes and the proof path, and whether the proof rebuilds the root.

Formula

leaf = SHA-256(item)

parent = SHA-256(left + right)

with prefixes: leaf = SHA-256(00 + item), parent = SHA-256(01 + left + right)

proof = the sibling hash at every level, with its side

Carrying an odd node up unchanged, with the prefixes on, gives the same tree as the Merkle hash of RFC 6962; the tests confirm this against a separate recursive version for 1 to 33 items.

Five items

The items tx1 to tx5 give 5 leaves, then 3 nodes (the last item hashed with itself), then 2, then the root, so there are 4 levels. With the duplicate rule the root is e005b5664946b94dcae30e856ab0058930eb5ec65ca113c90331454335612140.

The proof for item 3 has 3 hashes: its neighbor tx4, the hash of the pair tx1 and tx2, and the branch that holds only tx5. Hashing tx3 and combining it with those on the stated sides rebuilds the root. Changing the item to "tx3 (edited)" gives a different root, so the proof fails.

What a Merkle tree is good for

A single root hash stands for a whole list. Anyone holding the root can check that one item belongs to the list from a short proof, whose length grows with the logarithm of the list size, without seeing the other items. Version control systems, certificate logs, some databases and blockchains use this idea.

The odd node rule matters. Hashing the last node with itself makes the lists a b c and a b c c share a root, a flaw that has been exploited in practice. Marking leaves and inner nodes with different prefixes also stops an inner hash from being passed off as an item. See the Hash Generator to check a single hash and the HMAC Generator for keyed hashes.

Matching other systems

Real systems fix many details: how items are encoded, the order of left and right, how odd nodes are handled and what the prefixes are. A root built here matches another system only when its rules are exactly these.

Assumptions and limits

  • SHA-256 is used and each non-empty line is one item; blank lines are skipped.
  • Items are encoded as UTF-8 text, not as hex or raw bytes.
  • Up to 128 items are accepted and the item number to prove counts from 1.
  • Hashes in the tables are shortened to the first 8 or 16 hex digits; the root is shown in full.
  • The page builds and verifies in your browser and nothing is uploaded.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

Why does a proof not need the other items?

The sibling hashes already contain the other items' information. Combining your item's hash with them in order reproduces every parent up to the root.

Why add the 00 and 01 prefixes?

They separate leaf hashes from inner hashes, so a pair of leaves can never be mistaken for a single leaf. Without them, some attacks become possible.

What does carry it up as is mean?

An odd last node is copied to the next level unchanged, instead of being hashed with itself. No two different lists then share a root.

Is this the Merkle tree Bitcoin uses?

Bitcoin hashes the last node with itself when a level is odd, and uses double SHA-256 on binary data. The duplicate setting has the tree shape, but not the double hashing.