HOW-TO GUIDE

How to count lines of code in a GitHub repo

The standard answer is "clone it and run cloc." That's still the right call for a precise, language-by-language audit — but if you just want a fast sense of scale before deciding whether to dig in further, there's a much lighter option.

Two different questions that look the same

"How many lines of code does this repo have" usually means one of two things. Sometimes it's a precise question — you're doing a formal audit, generating a report, or need an exact per-language breakdown, in which case a dedicated command-line tool run against a full local clone is genuinely the right instrument. Other times it's a rough, exploratory question — "is this a 500-line script or a 50,000-line application?" — asked before you've committed to cloning anything at all. RepoKit is built for the second case.

Install RepoKit

Add RepoKit to Chrome — free, instant, no setup.

Open the GitHub repository

Navigate to it as normal. RepoKit annotates the file tree automatically.

Read the line estimate next to each file or folder

Every row shows an estimated line count alongside its byte size, letting you see both at once.

Check the toolbar summary for a repo-wide total

A running total near the top of the page gives you the whole repository's estimated line count without adding anything up yourself.
When to reach for a real audit tool instead

If you need a precise, defensible number — for a report, a licensing review, or a formal codebase assessment — clone the repo and run cloc or tokei, which categorize by language and separate code from comments and blank lines. RepoKit's estimate is for fast orientation, not compliance documentation.

Why this beats GitHub's language bar for this specific question

GitHub already shows a colored language bar on every repo, but it's measuring bytes per language, not lines — a file full of long lines and a file full of short lines can show identical byte proportions while representing very different amounts of actual code. Line count is a closer proxy for "how much did someone actually write here," which is usually the real question behind "how big is this codebase."

Frequently asked questions

Is there a way to do this without installing anything?+
Yes — cloning the repo and running a tool like cloc or tokei locally gives you precise, categorized line counts (broken down by language, comments vs. code, etc). That's the right choice for a serious one-time audit. RepoKit trades that precision for zero setup and instant, repo-wide coverage without leaving your browser.
Does GitHub have a built-in line counter anywhere?+
Not in the main interface. GitHub shows a language breakdown bar (the colored bar near the top of a repo) based on bytes per language, not line counts, and that's the closest built-in equivalent — it answers a related but different question.
Will this work on a repo with many different programming languages?+
Yes — the estimate counts lines regardless of language, treating any text-based file the same way. It won't break the total down by language, but it will count consistently across a polyglot codebase.
Keep exploring

Related pages

See line-count estimates on every GitHub repo you open.

No cloning, no command line — just open the repo and read the numbers.

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