Git Conventional Commit & URL Converter
About Git Tree Hash Calculator
The Git Tree Object Hash Builder constructs binary Git tree entries (`<mode> <filename>\0<20-byte-sha>`) and calculates the exact 40-character SHA-1 tree hash representing a directory state.
How to Use Git Tree Hash Calculator
Step 1
Add files with their permissions mode (`100644`, `100755`), filename, and blob SHA-1.
Step 2
Review the assembled binary tree object representation.
Step 3
Inspect the computed Git tree SHA-1 hash.
Step 4
Click "Copy Tree Hash".
Practical Use Cases for Git Tree Hash Calculator
Understanding Git Directory Object Storage
Learn how Git tracks directories as binary tree objects containing mode numbers (`100644` normal file, `100755` executable, `040000` directory), filenames, and SHA hashes.
Debugging Git Tree Parsing in Custom Tooling
Verify binary tree object serialization and hash computation for custom Git plumbing utilities and Wasm Git engines.
Input & Output Examples
Hashing Empty Git Directory Tree
Empty tree (0 entries)
Raw Payload: `tree 0\0` | Git SHA-1: `4b825dc642cb6eb9a060e54bf8d69288fbee4904` (The famous empty tree hash)
Key Features & Performance
- ✓Supports standard Git tree modes: `100644` (File), `100755` (Executable), `040000` (Subtree / Directory), `120000` (Symlink), `160000` (Submodule).
- ✓Calculates both SHA-1 (40 hex chars) and SHA-256 tree hashes.
- ✓Auto-sorts tree entries according to canonical Git sorting rules (subtrees sorted as if ending with `/`).
- ✓100% Client-Side memory execution.
- ✓1-Click Copy tree hash.
Key Terminology & Definitions
Git Tree Object
A Git object representing a directory state, mapping filenames and file modes to blob and subtree SHA-1 hashes.
Empty Tree Hash (`4b825dc...`)
The universal SHA-1 hash of an empty Git directory (`tree 0\0`), commonly used in Git diffs against the initial commit.
