Skip to content
ENExplore Calculators

Technical Debt Ratio Calculator

Work out technical debt ratio instantly with clear inputs, formula shown and shareable results.

About Technical Debt Ratio Calculator

The technical debt ratio divides remediation cost by the cost of building the system, which is how SonarQube derives its maintainability rating: 5 percent or less is an A, and above 50 percent an E. Expressing the same debt per thousand lines makes it comparable across codebases of different sizes and highlights which modules are disproportionately bad.

Formula

Technical debt ratio

TDR = remediation cost / development cost; grades at 5%, 10%, 20% and 50%

Worked example

With the default values below, Technical Debt Ratio Calculator returns Technical debt ratio of 7.50%. Change any input above and every figure here is recalculated in your browser.

Inputs used

Estimated remediation effortminimum 0 h
1,800 h
Effort to build the systemminimum 1 h
24,000 h
Lines of codeminimum 1
320,000
Loaded hourly costminimum 0
75

Results

Technical debt ratio
7.50%
Cost to remediate
$135,000
Maintainability grade
B
Remediation minutes per 1,000 lines
337.5

Step by step

  1. 1Values used
  2. 2Technical debt ratio
  3. 3Technical debt ratio= 7.50
  4. 4Cost to remediate= 135,000
  5. 5Maintainability grade= B
  6. 6Remediation minutes per 1,000 lines= 337.5

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax or compounding frequency into account.
  • Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Is the ratio a reliable measure?

It is a proxy. Static analysis remediation estimates are crude and miss architectural debt entirely, so use it as a trend line rather than an absolute figure.

What is the most important kind of debt to fix?

Debt in code you change often. Debt in stable, rarely touched modules costs nothing until you touch them, so weight by change frequency.

Technical Debt Ratio Calculator | Calcrivo