HOW-TO GUIDE

How to see folder size on GitHub

GitHub doesn't show folder sizes anywhere in its interface — not in the file listing, not in the API docs' most obvious endpoints, not even as an option in settings. Here's the fastest way to actually get that number, and why the "clone it and check" approach most people default to is more work than it needs to be.

The problem with the default approach

Ask most developers how to check a GitHub folder's size and they'll say "clone the repo and run du -sh foldername." That works, but it means downloading the entire repository — every branch reference, every file, potentially hundreds of megabytes — just to answer a question about one directory. For a quick curiosity check, that's a disproportionate amount of work, bandwidth, and disk space for the answer you're actually after.

There's a lighter-weight path: GitHub's own API already knows every file's size, because it has to in order to serve the repository at all. The trick is that this data isn't rendered anywhere in the normal github.com interface — it exists, but you have to go get it deliberately.

Install RepoKit

Add RepoKit from the Chrome Web Store. It's free, requires no account, and needs no configuration — it starts working the moment you land on a GitHub repository.

Open the repository you want to check

Navigate to the repo on github.com as you normally would. RepoKit annotates the page automatically within about a second of the tree loading.

Look at the folder row

Every folder in the listing now shows a size badge — for example 4.2 MB — representing the recursive total of everything inside it, not just its immediate contents.

Check the toolbar for the whole-repo total

A REPO TOTAL badge near the search/download toolbar sums every file currently in the tree, giving you the full repository size in the same glance.

Click into subfolders for nested sizes

The same badges apply at every depth — click into any subdirectory and its contents are sized immediately, no re-scan or extra step required.
Why this beats cloning

Because RepoKit reads size metadata directly from GitHub's Git Trees API rather than downloading file contents, you get an answer without transferring the files themselves at all — the size check itself uses a fraction of the bandwidth that actually downloading the folder would.

What if you only need the number once, and don't want an extension?

If you genuinely only need this one time, GitHub's API is public and can be queried directly with a tool like curl against the Git Trees endpoint, summing the size field across matching paths yourself. It works, but it requires knowing the exact API shape, handling pagination for large trees, and doing the arithmetic by hand — which is exactly the manual work RepoKit exists to skip. For anyone checking folder sizes more than once, the extension pays for itself in the first use.

Frequently asked questions

Can I see a folder's size without downloading it first?+
Yes — that's the whole point of this approach. RepoKit reads size data from GitHub's API metadata, so you see the number before you've transferred a single byte of the folder's actual contents.
Does this work for the root of the repo, or only subfolders?+
Both. The repository root gets a total size badge in the toolbar, and every folder at every depth gets its own individual badge as you navigate into it.
What if the repo is very large — will this be slow?+
GitHub's tree API returns the whole recursive structure in one request for most repositories, so sizing typically appears within a second or two even for repos with thousands of files. Extremely large monorepos may take a little longer, and GitHub's API itself will mark a response as truncated in rare edge cases.
Keep exploring

Related pages

See every folder's size on GitHub automatically.

Install RepoKit once and size badges appear on every repo you visit from then on.

Add RepoKit to Chrome — it's free
Free · No account required · Works instantly on github.com