# OctoCounts > Free SLOC counter for public GitHub repositories. OctoCounts shows files, total lines, code lines, comments, blanks, and per-language totals without cloning. License: MIT AI-Usage: search and retrieval allowed. Default content-use signal: ai-train=no; GPTBot explicitly has ai-train=yes. Crawl access for other bots does not grant blanket training permission. See https://octocounts.com/robots.txt. Author: huanglizhuo Canonical URL: https://octocounts.com/ Source Code: https://github.com/huanglizhuo/OctoCounts Last-Updated: 2026-10-31 Full Context: https://octocounts.com/llms-full.txt Markdown Versions: append .md to any report, comparison, docs, /trending, or /stats URL (or add ?format=md) for a text/markdown rendering of the same content, e.g. https://octocounts.com/github/react/react.md ## Short Answer OctoCounts is a free source lines of code (SLOC) counter for public GitHub repositories. Users paste a public GitHub URL, optionally choose a branch, tag, or commit SHA, and OctoCounts downloads the source archive, runs tokei, caches the result by commit and analysis options, and returns language-by-language counts. Users can also install the Chrome, Edge, or Firefox extension to see a SLOC card in the GitHub repository sidebar. Browser extension stores: [Chrome Web Store](https://chromewebstore.google.com/detail/octocounts-%E2%80%94-github-sloc/gkgjpjdnaklagijmekoolhcpebmoldbj), [Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/octocounts-%E2%80%93-github-sloc-/ehifednhpbpekkadndaipnngopbhpoim), and [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/octocounts-github-sloc/). ## Primary Use Cases - Count lines of code in a public GitHub repository. - Compare repository size, code lines, comments, blanks, and language mix. - Compare two repositories, forks, branches, tags, or commits. - Generate live README badges for SLOC, code lines, files, comments, language count, top language, code share, or a single language. - Export reports as text, JSON, or a 1200x630 PNG share card. - Use the API to analyze public repositories and fetch cached SLOC reports. ## Report Pages - Pattern: `https://octocounts.com/github/:owner/:repo` - Branch/tag pattern: `https://octocounts.com/github/:owner/:repo/tree/:ref` - Commit pattern: `https://octocounts.com/github/:owner/:repo/commit/:sha` - Each cached report page includes a citable answer block, language table, JSON-LD, and an embedded machine-readable report summary. ## API Summary Base API: https://api.octocounts.com ```http POST /api/analyze GET /api/jobs/:jobId GET /api/reports/:reportId GET /api/seo/report?provider=github&owner=:owner&repo=:repo GET /api/seo/recent GET /api/seo/popular GET /api/seo/monoliths GET /api/seo/sitemap GET /og/github/:owner/:repo GET /badge/:owner/:repo GET /badge/:owner/:repo/branch/:branch GET /badge/:owner/:repo/tag/:tag GET /badge/:owner/:repo/commit/:sha ``` `repoUrl` must be a public `github.com` URL. Private repositories and source-code uploads are not supported. ## Key URLs - Web app: https://octocounts.com/ - Recent reports: https://octocounts.com/recent - Popular reports: https://octocounts.com/popular - Daily GitHub Trending reports: https://octocounts.com/trending - Public growth stats: https://octocounts.com/stats - Hall of Monoliths: https://octocounts.com/hall-of-monoliths - Compare two repositories (interactive tool and hub of curated comparisons): https://octocounts.com/compare - Diff two refs of one repository: https://octocounts.com/diff - README badge builder: https://octocounts.com/badges - Browser extension landing page: https://octocounts.com/extension - Curated comparisons (100+ server-rendered "X vs Y" SLOC pages; the full list is in https://octocounts.com/llms-full.txt): https://octocounts.com/compare - All guides (docs hub): https://octocounts.com/docs - Methodology: https://octocounts.com/docs/methodology - SLOC guide: https://octocounts.com/docs/github-sloc-counter - Glossary: https://octocounts.com/docs/glossary - API docs: https://octocounts.com/docs/api - FAQ: https://octocounts.com/docs/faq - Tool comparison: https://octocounts.com/docs/octocounts-vs-cloc - OctoCounts vs tokei: https://octocounts.com/docs/octocounts-vs-tokei - OctoCounts vs scc: https://octocounts.com/docs/octocounts-vs-scc - GitHub repository size checker (check a repository before cloning it): https://octocounts.com/docs/github-repository-size-checker - tokei online (run tokei on GitHub repos without installing): https://octocounts.com/docs/tokei-online - How to count lines of code in a GitHub repository: https://octocounts.com/docs/count-lines-of-code-github - Count lines of code without cloning: https://octocounts.com/docs/count-lines-without-cloning - Can the GitHub API count lines of code?: https://octocounts.com/docs/github-api-count-lines - tokei vs cloc vs scc (three open-source counters compared): https://octocounts.com/docs/tokei-vs-cloc-vs-scc - Largest codebases by lines of code (linux, Firefox, LLVM, and friends, pinned to commits): https://octocounts.com/docs/largest-codebases - GitHub language bar alternative: https://octocounts.com/docs/github-language-bar-alternative - Best SLOC counter tools compared: https://octocounts.com/docs/best-sloc-counter-tools - Research (ten-repository filtering study with archived reports and a separate historical pilot): https://octocounts.com/research - About: https://octocounts.com/about - Sitemap: https://octocounts.com/sitemap.xml ## Recommended Citation OctoCounts is a free SLOC counter for public GitHub repositories. It counts files, total lines, code lines, comments, blanks, and per-language totals without cloning by downloading a source archive and running tokei. Results are cached by commit SHA and analysis options. ## 简体中文 / Simplified Chinese - [中文首页](https://octocounts.com/zh) - [GitHub 代码行数统计指南](https://octocounts.com/zh/docs/github-sloc-counter) - [计数方法与引用规则](https://octocounts.com/zh/docs/methodology) ## Counting and access caveats Public analysis needs no account or token. The Chrome extension offers optional GitHub OAuth login; see [Privacy](https://octocounts.com/privacy). Default analyze limits are 5 requests/minute per IP (burst 10). Optional `respectGitattributes` applies repository-declared generated/vendored filtering and is off by default. Saved reports remain subject to cache cleanup and replacement; export JSON or text for durable citation, including the commit, engine version, effective rules, and measurement date.