SonarQube is priced by lines of code. SonarQube Cloud's Team plan starts at about $34 a month for up to 100k lines of code, and SonarQube Server's paid editions are priced per instance, per year, based on your lines of code. There are two free options, each with limits.

ProductPlan or editionPriceNotes
SonarQube CloudFree$0Private projects up to 50k lines of code; "No card, no expiry"
SonarQube CloudOpen source$0Public, OSI-licensed repositories
SonarQube CloudTeamFrom about $34/monthUp to 100k lines of code; more lines cost more; for teams under 50 developers
SonarQube CloudEnterpriseCustomFor teams over 50 developers
SonarQube ServerCommunity Build$0Self-hosted and open source; no pull request or branch analysis
SonarQube ServerDeveloperContact salesPer instance, per year, by lines of code; recommended for 100k+ lines
SonarQube ServerEnterpriseContact salesRecommended for 1M+ lines
SonarQube ServerData CenterContact salesPer instance, per year, by lines of code

Sources: Sonar's plans and pricing and SonarQube Server editions pages, read on 13 October 2026. Sonar's own FAQ quotes the Team plan at $32 a month, so expect small differences; check the page before you buy.

How lines of code are counted

Sonar's FAQ explains the count that your bill depends on:

  • Every project counts. Sonar sums the lines of code of each project analyzed on an instance.
  • Only code counts. Blank lines, comments and test code are never included.
  • The biggest branch counts. Each project counts the lines in its largest branch or pull request.

So a monorepo, or a long-lived branch that's bigger than main, raises the count.

What happens at the limit

Sonar notifies you as you approach your licensed lines of code. Past the limit, Sonar says the Server instance "will reject any new analysis whose total lines of code exceed the limit defined by your license", while basic functionality keeps working. In practice, a growing codebase means a bigger plan or fewer analyzed projects.

What the free options leave out

  • Community Build doesn't check pull requests. Sonar's documentation says pull request analysis is available starting in Developer Edition. Your options are covered in SonarQube Community Build pull request analysis.
  • The Cloud free tier stops at 50k lines of code for private projects, and Sonar describes it as "basic code review functionality".
  • Commercial support is extra below Enterprise and Data Center at 30M lines of code, according to Sonar's FAQ.

A free alternative without a lines-of-code meter

Skylos is free and open source (Apache-2.0). Its CLI and pull request gate run on your machine and in your CI with no account, no seats and no lines-of-code limit:

pip install skylos
skylos cicd init --no-upload

That writes a GitHub Actions workflow that checks the changed lines of every pull request: security issues, secrets, vulnerable dependencies, dead code, and coding-agent mistakes such as imports of functions that don't exist.

Skylos is narrower than SonarQube: fewer languages, and no coverage or duplication gates or portfolio views. Many teams run both. See SonarQube alternative: Skylos vs SonarQube for the full comparison.