Repository Size Calculator
Estimate total Git repository size including history, objects and packfiles.
About Repository Size Calculator
A repository's on-disk footprint is the sum of its .git directory (loose objects awaiting packing, compressed packfiles holding history, and any Git LFS content) plus the working tree of checked-out files. Formula: total = loose_objects + packfiles + lfs_objects + working_tree. A high .git-to-working-tree ratio usually signals deep history or large binaries that were committed directly instead of through LFS.
Formula
total_repo_MB = loose_objects + packfiles + lfs_objects + working_tree
- loose_objects
- Uncompressed loose object size (MB)
- packfiles
- Compressed packfile size (MB)
- lfs_objects
- Git LFS storage size (MB)
- working_tree
- Checked-out working tree size (MB)
Worked example
With the default values below, Repository Size Calculator returns Total Repository Size of 710. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Loose Objects Sizeaccepts 0–1,000,000 MB
- 40 MB
- Packfile Sizeaccepts 0–1,000,000 MB
- 350 MB
- Git LFS Storageaccepts 0–1,000,000 MB
- 120 MB
- Working Tree Sizeaccepts 0–1,000,000 MB
- 200 MB
Results
- Total Repository Size
- 710 MB
- .git Directory Size
- 510 MB
- Total Repository Size
- 0.69 GB
- .git / Working Tree Ratio
- 2.55 ×
- LFS Share of .git
- 23.5%
Step by step
- 1.git directory: loose + packfile + LFS= 510MB
- 2Total repository: .git + working tree= 710MB
- 3.git-to-working-tree ratio= 2.55×
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why is my .git folder bigger than my actual code?
Every version of every file you've ever committed still lives in .git's history, even after deletion. Large binaries, generated files, or media committed directly (instead of via LFS) accumulate across commits and bloat the packfile.
How do I find the real size of loose objects vs packfiles?
Run `git count-objects -v` — it reports loose object count/size and, after a `git gc`, the packed size. `du -sh .git` gives the total directory size.
Does Git LFS reduce .git size?
Yes — LFS stores pointers (a few bytes) in Git history and keeps actual large file content in separate LFS storage, so .git/objects and packfiles stay small even as binary history grows.
How can I shrink an existing bloated repository?
Run `git gc --aggressive` to repack loose objects, or use `git filter-repo`/BFG Repo-Cleaner to rewrite history and remove large blobs, followed by a fresh clone to reclaim disk space.
