Free tool

Lines of code counter

A lines of code counter for whole repositories: choose a folder and see code, comments and blank lines by language, without uploading anything.

Updated

Your browser may ask to confirm it can read the folder. It reads the files here; nothing is uploaded. node_modules, .git, vendor and build folders are skipped.

Runs entirely in your browser. No file is sent to us or stored.

Runs in your browserBuilt and maintained by the DataBroker team

How to use the lines of code counter

  1. Step 1

    Choose the folder

    Pick the top folder of the repository. Your browser may ask you to confirm it can read the folder's files.

  2. Step 2

    Wait for the count

    Each file is read on your machine. Dependency, build and version-control folders are skipped.

  3. Step 3

    Use the total

    Read the table by language, then put the code total into the codebase value calculator for a rebuild-cost estimate.

What is a lines of code counter?

A lines of code counter reads a project's source files and reports how many lines are code, comments and blank, usually per language, so you can describe a codebase's size in one number.

Lines of code counter specs and limits

InputA folder picked from your computer; every file under it is read locally with the browser's File API
LanguagesAbout 60 file types by extension, including TypeScript, JavaScript, Python, Go, Rust, Java, C, C++, C#, PHP, Ruby, Swift, Kotlin, SQL, HTML, CSS, YAML and Markdown
Skippednode_modules, .git, vendor, dist, build, .next, target, virtualenvs and similar folders; lock files, minified files, source maps, binaries and files over 1 MB
Comment rulesA line holding only a comment, or inside a block comment, is a comment line. A line with code and a trailing comment is code. Comment markers inside strings aren't detected
Where it runsIn your browser. No file is uploaded or stored
Not includedZIP files (unzip first), private GitHub URLs, and duplicate-file detection

More about the lines of code counter

What the lines of code counter reports

The result is a table with one row per language: files, blank lines, comment lines and code lines, sorted by code. Above it are the four totals. The split follows the convention of cloc, the long-standing command-line counter: every physical line is exactly one of blank, comment or code.

Example: a typical web app repository might show TypeScript first, then CSS, JSON and Markdown. JSON and Markdown lines count as code in this table because they aren't comments; leave them out of the total if you only want hand-written program code.

Why line counts matter when selling a codebase

Size is the first thing a buyer of a private codebase asks about, because it tells them roughly how much work went into it and how much training material it holds.

Turing, which publicly says it acquires codebases along with their context, describes paying up to $100K or more depending on complexity, and lists repos, tickets, design documents and support threads as what it wants.

It publishes no minimum size, and neither do most other buyers, so a line count is a description, not a qualification.

The order to prepare a codebase for a buyer, as the list below explains.
  • Report code lines, not total lines; buyers discount blanks, and comments are worth little without code.
  • Separate your own code from vendored or generated code. The counter skips the common folders, but checked-in generated files need removing by hand.
  • Check the licences next. Code copied from copyleft projects can't be sold on exclusive terms; the open source license checker finds licence files, manifests and SPDX headers in the same folder.
  • Scan for secrets and personal data before sharing any sample. The PII scanner flags keys and personal details in text files.

Limits

If it doesn't work

The picker only lets me choose files
Folder picking needs a desktop browser such as Chrome, Edge, Firefox or Safari. On a phone, use a computer instead.
It says no source files were found
You may have picked a build or dependency folder, which is skipped. Pick the repository's top folder.
The count is much higher than expected
Generated code that isn't in a standard build folder, such as checked-in API clients or data files saved as JSON, is counted. Look at the per-language rows to find it.

Sources

2 sources · checked Nov 9, 2026

  1. cloc on GitHubChecked
  2. Turing, AGI Advance newsletter, 26 May 2026Checked

Lines of code counter FAQ

All DataBroker questions →

How do I count lines of code in a repo?

Pick the repository's top folder in the counter above. It reads every source file locally and reports code, comment and blank lines by language. On the command line, cloc does the same.

Is my code uploaded?

No. Files are read by your browser on your own computer. Nothing is sent to us or stored.

Does it count node_modules?

No. Dependency folders such as node_modules and vendor, build output and the .git folder are skipped, so the total is your project's own files.

Can I count a GitHub repository by URL?

Not here: clone or download it and pick the folder. The codebase value calculator can read a public GitHub repository's size from GitHub's API.

How many lines of code does a codebase need to sell?

Buyers rarely publish a minimum. What they say they look for is real, working code with context such as tickets and documentation, so size is one factor among several.

Related

  • The codebase value calculator with 50,000 lines of code typed in at $100 an hour: an estimated rebuild cost of $2,218,060, 145.9 person-months of effort over 16.6 months with an average team of 8.8 people.
    Codebase value calculator

    A codebase value calculator that reads a public GitHub repository in your browser and estimates rebuild effort and cost with basic COCOMO.

  • Open source license checker

    An open source license checker for a whole repository: it finds every licence it can and flags those to review before selling the code.

  • How to sell software you have built

    How to sell software you have built, whether that means the whole product, the IP, or licensing the codebase as training data.

  • How to sell data to AI companies

    Sell data to AI companies only after you can prove where it came from, that you may license it, and why it isn't online already.

  • The PII scanner on its own made-up sample rows: 8 possible findings, among them a US Social Security number, a Luhn-checked payment card number, 2 email addresses, 2 phone numbers, a public IP address and a hard-coded key, each shown masked, with buttons to copy or download the redacted text.
    PII scanner

    A PII scanner that runs in your browser: paste text or drop a file to see personal data and leaked secrets before you share it.

  • Open source licenses in a codebase sale

    Open source licenses in a codebase sale rarely stop it; they limit what the seller can promise about the borrowed parts.

Free tool

Try the lines of code counter

A lines of code counter reads a project's source files and reports how many lines are code, comments and blank, usually per language, so you can describe a codebase's size in one number.

  • Free
  • No sign-up
  • Runs in your browser