Skip to main content

Merkle Tree Generator

Generate a Merkle tree from a list of addresses or values. Get the Merkle root, proofs for each entry, and Solidity verification code.

Options

Sorting makes the tree deterministic regardless of proof order. OpenZeppelin's MerkleProof uses sorted pairs.

Enter addresses above to generate the tree.

Frequently Asked Questions

What is a Merkle tree?▼

A Merkle tree is a binary tree where each leaf node contains the hash of a data element, and each internal node contains the hash of its two children. The root hash (Merkle root) summarizes the entire dataset. Changing any single leaf changes the root, making it tamper-evident.

How are Merkle trees used in NFT allowlists?▼

NFT projects use Merkle trees to manage allowlists (whitelists) gas-efficiently. Instead of storing thousands of addresses on-chain, only the Merkle root is stored. When a user wants to mint, they provide a Merkle proof (a path of sibling hashes) that their address is in the tree. The contract verifies the proof against the root.

What is a Merkle proof?▼

A Merkle proof is a set of sibling hashes from the leaf to the root. To verify that a leaf is in the tree, you hash the leaf with each proof element in sequence until you reconstruct the root. If the computed root matches the stored root, the leaf is valid.

How does OpenZeppelin's MerkleProof work?▼

OpenZeppelin provides MerkleProof.verify(bytes32[] proof, bytes32 root, bytes32 leaf). The leaf is typically keccak256(abi.encodePacked(address)). You generate the root off-chain, store it in the contract, and generate proofs for each allowlisted address to provide during mint.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →