Merkle Tree

Build a hash tree and inspect and test leaf proofs.

About this tool

Enter one leaf per line. Leading and trailing whitespace is removed and blank lines are ignored. Up to 16 leaves and 16,384 UTF-16 characters are accepted; longer input is rejected, never truncated. Build runs only when requested. Clear removes the input and result.

This demonstration hashes UTF-8 text: a leaf is SHA-256 of L:text; a parent is SHA-256 of N:left|right, where left and right are the full lowercase hexadecimal hashes. The last leaf is duplicated until the leaf count is a power of two. This is a teaching convention, not the tree format used by Bitcoin or Certificate Transparency. Without Web Crypto, the explicitly labelled FNV-1a fallback is not cryptographically secure.

Change leaf appends ! to the selected text; it does not flip a binary bit. Its original root is available under Proof and hashes. Choose a leaf to highlight its path. The diagram shows six hexadecimal characters per node; complete hashes are in node descriptions and the details. Wide trees scroll within their own area.

Under Proof and hashes, change the candidate text and press Verify: the existing sibling hashes are folded in order against the displayed root without rebuilding the tree. Matching a locally generated root does not establish authenticity; that requires a trusted root. Input changes, cancellation and navigation discard pending results; an individual Web Crypto digest cannot itself be interrupted. A restored result is a saved snapshot, not a new cryptographic check; Verify checks again. Damaged tree snapshots are discarded while their raw input is kept. States above automatic storage capacity stay live while navigating within the app, show a warning and retain the previous saved copy after reload. Export before reloading. Wide trees scroll locally to the chosen leaf; the complete root remains above the diagram.

Only input values are remembered in this browser. Calculated results and experiment histories are not saved.